TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Official guide for organizing Go projects and modules

83 点作者 dondraper36超过 1 年前

5 条评论

dondraper36超过 1 年前
Finally, there is an official document with recommended ways to structure your Go project.<p>To be honest, it&#x27;s really minimal and liberal but that is definitely better than what is by an unfortunate name collision considered the official Go layout now.
评论 #37688041 未加载
评论 #37577948 未加载
mmcallister超过 1 年前
Compare and contrast this with the Go Standards project-layout repo example[1] - which ironically is not a standard at all.<p>Personally I prefer a bit more rigidity in how the project is structured (&#x2F;pkg&#x2F;, &#x2F;pkg&#x2F;internal&#x2F;, &#x2F;cmd&#x2F;) since it is more opinionated and requires less thinking. Typically my repos won&#x27;t just have a Go backend but also a frontend too, and supporting assets, as well as documentation (designs, decisions, etc.)<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;golang-standards&#x2F;project-layout">https:&#x2F;&#x2F;github.com&#x2F;golang-standards&#x2F;project-layout</a>
Zababa超过 1 年前
I knew it reminded me of something! Eli Bendersky&#x27;s post <a href="https:&#x2F;&#x2F;eli.thegreenplace.net&#x2F;2019&#x2F;simple-go-project-layout-with-modules&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;eli.thegreenplace.net&#x2F;2019&#x2F;simple-go-project-layout-...</a> now starts with &quot;Update (2023-09-19): We&#x27;ve now published similar guidelines as part of Go&#x27;s official documentation. This blog post will remain up-to-date.&quot; I&#x27;ve learned a lot about Go from this website.
js2超过 1 年前
Questions left unanswered:<p>- When are go multi-module workspaces best used?<p>- What should you use for the module-path argument to `go mod init` if you don&#x27;t ever intend to share the repo or you don&#x27;t yet know where you will be sharing it?
评论 #37580227 未加载
评论 #37581222 未加载
burgerrito超过 1 年前
Is this a new page? Don&#x27;t remember if I&#x27;ve read this one or not.