30

I wanted to install gb

The installation steps says to execute the command:

go get github.com/constabulary/gb/...

What does the ... mean in this case?

Sundar
  • 1,691
  • 1
  • 14
  • 20
  • 2
    @DaveC I did check the `go get -h`, somehow I missed the point to check the `go help packages`. I searched in Google/StackOverflow, but was not able to find anything on this. Having such questions in SO helps lot of other people who are also searching for such questions, and they would also get to know more about what this is. I agree that it would have been better if I have found it myself, but I wanted to clarify that I did not ask the question just because I did not want to search myself. I did it. I searched, and when I was not able to find, I landed up in SO – Sundar Aug 12 '15 at 09:23

1 Answers1

37

The ... (ellipsis) tells go get to also fetch the package's subpackages/dependencies.

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

For an example of how you'd use it, check out this answer.

Community
  • 1
  • 1
Wander Nauta
  • 18,832
  • 1
  • 45
  • 62