Skip to content

Instantly share code, notes, and snippets.

@namp10010
Created November 28, 2023 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save namp10010/0736e490c878cfb8c8c2a48762486292 to your computer and use it in GitHub Desktop.
Save namp10010/0736e490c878cfb8c8c2a48762486292 to your computer and use it in GitHub Desktop.
go cmd matching globbing pattern

go cmd matching globbing pattern

https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns

go [space separated packages]

go test - the current directory as a package

go test ./dir - directory relative to current directory

go test ../dir - directory relative to the current directory

go test dir/... - /... at the end of the pattern can match an empty string, so that net/... matches both net and packages in its subdirectories, like net/http

go test ./... - match all packaged found in current directory and all of its subdirectories with exception below.

any slash-separated pattern element containing a wildcard never participates in a match of the "vendor" element in the path of a vendored package, so that ./... does not match packages in subdirectories of ./vendor or ./mycode/vendor, but ./vendor/... and ./mycode/vendor/... do

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