英文:
Goclipse workspace for golang vs other languages
问题
我在/home/user/Documents/code/workspace/(Debian Jessie)中有一些代码,子文件夹中有java/用于Java和python/用于Python。对于在Eclipse中使用golang,我应该使用工作区~/Documents/code/workspace还是../workspace/go或../workspace/go/src?
英文:
I have code in /home/user/Documents/code/workspace/ (Debian Jessie) in subfolders like java/ for java and python/ for python I've written. For golang in Eclipse, should I use the workspace ~/Documents/code/workspace or ../workspace/go or ../workspace/go/src?
答案1
得分: 1
请使用workspace/go作为您的工作空间。根据golang.org上的代码组织指南:
- src目录包含按包组织的Go源文件(每个目录一个包),
- pkg目录包含包对象,
- bin目录包含可执行命令。
go工具会构建源代码包,并将生成的二进制文件安装到pkg和bin目录中。
通常,src子目录包含多个版本控制存储库(如Git或Mercurial),用于跟踪一个或多个源代码包的开发。
英文:
Use workspace/go as your workspace. From code organization guidelines on golang.org
> Go code must be kept inside a workspace. A workspace is a directory
> hierarchy with three directories at its root:
>
> - src contains Go source files organized into packages (one package per directory),
> - pkg contains package objects, and
> - bin contains executable commands.
>
> The go tool builds source packages and installs the resulting binaries
> to the pkg and bin directories.
>
> The src subdirectory typically contains multiple version control
> repositories (such as for Git or Mercurial) that track the development
> of one or more source packages.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论