GOMOD,将排除哪些文件夹/文件?

发布于 2025-01-29 07:39:33 字数 87 浏览 2 评论 0原文

Golang使用GOMOD,将排除某些Floder/Files。例如示例/包括floder和 *_test.go类型文件。

那么,所有规则是什么?

Golang use gomod, Some floder/files will be excluded. Such as example/include floder and *_test.go type file.

So, What are all the rules?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

菩提树下叶撕阳。 2025-02-05 07:39:33

go tool documentation 说:

软件包文档中的文件被GO命令忽略。

以“”开头的目录和文件名。或“ _”被GO工具忽略,名为“ TestData”的目录也被忽略

此外, build noreferrer> build command 说:

编译软件包时,构建忽略以'_test.go'结尾的文件。

构建约束也可以用来忽略文件。

The Go tool documentation says:

Files in package documentation are ignored by the go command.

and

Directory and file names that begin with "." or "_" are ignored by the go tool, as are directories named "testdata".

Additionally, the documentation for the build command says:

When compiling packages, build ignores files that end in '_test.go'.

Build constraints can also be used to ignore files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文