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

后端 未结 2 1235
借酒劲吻你
借酒劲吻你 2020-12-02 05:26

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 ./...
相关标签:
2条回答
  • 2020-12-02 06:06

    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.

    0 讨论(0)
  • 2020-12-02 06:15
    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.

    0 讨论(0)
提交回复
热议问题