Goclipse是针对Go语言的工作区,与其他语言相比。

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

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.

huangapple
  • 本文由 发表于 2015年12月18日 09:21:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/34347133.html
匿名

发表评论

匿名网友

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

确定