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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Organizing Golang and non-Golang projects?

1 点作者 rxlim超过 8 年前
For many years I have organized my projects in a single directory like this:<p><pre><code> |-- projects |-- project_0 |-- project_1 |-- project_2 </code></pre> A project regardless of programming language will get a directory under &#x27;projects&#x27;, that contains all files releated to this particular project.<p>Some time ago I started learning Golang and have since written many utilities in it as I like it very much. Golang requires a special directory layout for all it&#x27;s tools to work, and this layout is incompatible with the one I&#x27;m using.<p>What is the best way to organize Golang and non-Golang projects? Should I just bite the bullet and start organizing my projects by language?

1 comment

christophberger超过 8 年前
You could use a Go &quot;project&quot; that is in fact the $GOPATH, like so:<p><pre><code> |-- projects |-- project_0 |-- project_1 |-- project_2 |-- go |-- src |-- pkg |-- bin |-- project_4 |-- project_5 </code></pre> Your other projects would then not be affected at all.<p>Or consider using a tool like `gb` (<a href="https:&#x2F;&#x2F;github.com&#x2F;constabulary&#x2F;gb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;constabulary&#x2F;gb</a>) that does not depend on $GOPATH. (But ensure to understand the caveats of this tool before switching to it.)