英文:
whats the sense of having all projects in a single GOPATH workspace?
问题
为什么这是有意义的?我可以想到很多原因为什么我想要多个工作空间:
- 我为两家公司工作。
- 我有家庭项目和工作项目。
- 我有多个 Go 版本。
- 我正在同时处理一个库的两个版本。
英文:
Why does it makes sense? I can think of many reasons i want many workspaces:
- I work for two companies.
- I have home projects and work projects.
- I have multiple go versions.
- I'm working on two versions of a library
答案1
得分: 2
GOPATH是一个简化自动化的概念,开发者工具广泛使用它,这也是它的设计目标。GOPATH和操作系统的PATH类似,是一个列表,例如:
export GOPATH = PATH1:PATH2:PATH3
这可以回答你的一些问题。
英文:
GOPATH simplify automation, developers tools heavily use it which was design goal. And GOPATH like OS PATH is a list i.e.
export GOPATH = PATH1:PATH2:PATH3
that can answer some your questions.
答案2
得分: 0
使用GOPATH工作空间可以将所有安装的包或二进制文件保存在同一文件夹中,以便使开发人员的工作更加轻松。您不必直接使用它。由于编译器不关心您的go
文件路径,您始终可以为您的项目创建一个单独的文件夹,只需指定入口文件和编译文件的输出位置即可。就这么简单
英文:
Using an GOPATH workspace is usefull to keep all the installed packages or binaries in the same folders to make the developer's job easier. You are not bound to use it straight forward. Since the compiler doesn't care about you're go
files path, you can always create a separate folder for you're projects, just specify the entry file and the output of the compiled file..as simple as that
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论