“Go test”源代码的文档在哪里?

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

Where is "Go test" source code documented?

问题

我正在寻找“go test”命令的源代码,据我所知,它会执行一些奇特的操作(导出函数,重新编译包等)。到目前为止,我只找到了“testing”和cmd/go文档。

英文:

I'm looking for the source code of the "go test" command which afaik does some funky stuff (exports the functions, recompiles the package etc). So far I could find only "testing" and the cmd/go doc

答案1

得分: 4

你可以从cmd/go包开始查找,大部分go命令都在这里定义:

https://github.com/golang/go/blob/1ba29926f3bfd245d46cf1f287716290bc2f1034/src/cmd/go/test.go(最后已知提交的src/cmd/go/test.go,Go 1.8)
然后,提交4efe925显示src/cmd/go/test.go在Go 1.9(2017年1月)被重命名/移动为src/cmd/go/internal/test/test.go
最后一次修改:提交ca33f33于2018年10月,用于Go 1.12。

英文:

You can start looking in the cmd/go package, where most of the go commands are defined:

https://github.com/golang/go/blob/1ba29926f3bfd245d46cf1f287716290bc2f1034/src/cmd/go/test.go (last known commit with src/cmd/go/test.go, Go 1.8)
Then commit 4efe925 shows src/cmd/go/test.go being renamed/moved to src/cmd/go/internal/test/test.go in Go 1.9, Jan. 2017.
Last modification: commit ca33f33 in Oct. 2018 for Go 1.12.

huangapple
  • 本文由 发表于 2015年1月31日 21:47:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/28252295.html
匿名

发表评论

匿名网友

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

确定