英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论