`go build` 在没有指定具体要构建的包时,会如何决定要构建哪些子目录呢?

huangapple go评论71阅读模式
英文:

How does `go build` decide which subdirectories to build when it is not given specific packages to build?

问题

我最近注意到go build -a命令会构建几乎所有的子目录中的包,但并非全部。

go build命令使用什么算法来决定要构建什么?

go命令的文档没有具体说明,或者我可能读错了。

英文:

I have recently noticed that go build -a will build almost all, but not all packages in the subdirectories of my $GOPATH.

What algorithm does go build use to decide what to build?

The documentation for the go command did not specify, or I misread it.

答案1

得分: 3

如果没有指定路径,'go build'命令将在当前目录中构建包。文档在这里

'go build'命令还会构建任何过期的依赖项。

英文:

If no path is specified, the 'go build' command builds the package in the current directory. The documentation is here.

The 'go build' command also builds any out of date dependencies.

huangapple
  • 本文由 发表于 2015年7月9日 08:42:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/31306256.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定