<p>I have a React, Go, Mongo app. Must I put the whole thing inside $GOPATH/src/github.com/username/app/server/main.go (for example) if I want to go get stuff for it? </p>
<hr/>**评论:**<br/><br/>izuriel: <pre><p>No. Only the code that's written in Go needs to be in your GOPATH if your building your own server. </p>
<p>You fronted application and templates, or what have you can exist in its own folder so long as when you run the web server it knows where to find the rest of the project. </p></pre>abcded1234234: <pre><p>Most of the Go tools (such as go install, go test, etc) work only with the source code inside GOPATH.</p>
<p>In certain cases you can get away with putting your Go source code outside of GOPATH but instead of fighting with GOPATH I would recommend to learn how to use it.</p></pre>justinisrael: <pre><p>You could symlink just the Go code to your GOPATH. Or you could use gb which is project based. </p></pre>Justinsaccount: <pre><p>I had tried that, but a lot of tools seem to end up getting confused anyway.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传