What do three dots “./…” mean in Go command line i

2019-01-08 09:52发布

If you run Golang tests on Travis CI, it will download all of your dependencies with three dots:

go get -d -v ./... && go build -v ./...

What does ./... indicate or expand to there? I've done some research but it doesn't seem to be a Unix convention.

标签: go
2条回答
萌系小妹纸
2楼-- · 2019-01-08 10:11
go [command] ./...

Here ./ tells to start from the current folder, ... tells to go down recursively.

For Example:

go list ...

In any folder lists all the packages, including packages of the standard library first followed by external libraries in your go workspace.

查看更多
你好瞎i
3楼-- · 2019-01-08 10:12

From the command 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.

查看更多
登录 后发表回答