三个点“./...”在 Go 命令行调用中是什么意思?
What do three dots "./..." mean in Go command line invocations?
如果您 运行 Golang 在 Travis CI 上进行测试,它将 download all of your dependencies with three dots:
go get -d -v ./... && go build -v ./...
./...
表示或扩展到那里是什么?我做了一些研究,但它似乎不是 Unix 约定。
来自命令go help packages
:
An import path is a pattern if it includes one or more "..." wildcards,
each of which can match any string, including the empty string and
strings containing slashes. Such a pattern expands to all package
directories found in the GOPATH trees with names matching the
patterns. As a special case, x/... matches x as well as x's subdirectories.
For example, net/... expands to net and packages in its subdirectories.
go [command] ./...
这里./
表示从当前文件夹开始,...
表示递归往下走
例如:
go list ...
在任何文件夹中列出所有包,包括首先是标准库的包,然后是您的 go 工作区中的外部库。
如果您 运行 Golang 在 Travis CI 上进行测试,它将 download all of your dependencies with three dots:
go get -d -v ./... && go build -v ./...
./...
表示或扩展到那里是什么?我做了一些研究,但它似乎不是 Unix 约定。
来自命令go help packages
:
An import path is a pattern if it includes one or more "..." wildcards, each of which can match any string, including the empty string and strings containing slashes. Such a pattern expands to all package directories found in the GOPATH trees with names matching the patterns. As a special case, x/... matches x as well as x's subdirectories. For example, net/... expands to net and packages in its subdirectories.
go [command] ./...
这里./
表示从当前文件夹开始,...
表示递归往下走
例如:
go list ...
在任何文件夹中列出所有包,包括首先是标准库的包,然后是您的 go 工作区中的外部库。