Skip to content

Instantly share code, notes, and snippets.

@tsdtsdtsd
Last active July 9, 2022 18:10
Show Gist options
  • Save tsdtsdtsd/15d36079d45c30ff6992acc13563c2b4 to your computer and use it in GitHub Desktop.
Save tsdtsdtsd/15d36079d45c30ff6992acc13563c2b4 to your computer and use it in GitHub Desktop.
go tool doesn't exclude _ folder
go version
# Tested with:
# go version go1.17.6 linux/amd64
# go version go1.18.3 linux/amd64
pwd
# /tmp/go-test
go mod init example.com/user/go-test
# go: creating new go.mod: module example.com/user/go-test
mkdir _data
sudo chown root:my-user _data
sudo chmod 700 _data
go mod tidy
# pattern all: open /tmp/go-test/_data: permission denied
@tsdtsdtsd
Copy link
Author

As stated in go docs, _data folder in above case should not lead to a permission denied error:

Directory and file names that begin with "." or "_" are ignored by the go tool, as are directories named "testdata".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment