将所有项目放在单个GOPATH工作区中的意义是什么?

huangapple go评论66阅读模式
英文:

whats the sense of having all projects in a single GOPATH workspace?

问题

为什么这是有意义的?我可以想到很多原因为什么我想要多个工作空间:

  1. 我为两家公司工作。
  2. 我有家庭项目和工作项目。
  3. 我有多个 Go 版本。
  4. 我正在同时处理一个库的两个版本。
英文:

Why does it makes sense? I can think of many reasons i want many workspaces:

  1. I work for two companies.
  2. I have home projects and work projects.
  3. I have multiple go versions.
  4. 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文件路径,您始终可以为您的项目创建一个单独的文件夹,只需指定入口文件和编译文件的输出位置即可。就这么简单 将所有项目放在单个GOPATH工作区中的意义是什么?

英文:

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 将所有项目放在单个GOPATH工作区中的意义是什么?

huangapple
  • 本文由 发表于 2017年1月27日 15:41:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/41889021.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定