英文:
Does Go development require a paid Github account for private development?
问题
我刚刚开始学习Go语言。我大部分开发都使用Subversion,但是Go教程似乎假设所有东西都托管在Github上,要么是公共仓库,要么是(付费的)私有仓库。看起来我只能在以下选项中选择:
- 让每个人都能访问我写的所有内容;
- 每月花费7美元购买私有Github仓库;
- 不使用源代码控制;
- 失去使用Go的get/import功能的能力。
我是否漏掉了什么,或者这确实是情况?
英文:
I'm just getting started with Go. I use subversion for most of my development, but the Go tutorial seems to assume that everything is hosted on Github in either a public repository or a (paid) private repository. It looks like I'm forced to choose between:
- committing to everybody having access to everything I write,
- spending $7 a month for a private Github repository,
- not using source code control or
- losing the ability to use Go's get/import facility properly
Am I missing something here, or is this really the case?
答案1
得分: 8
go get
支持大多数git、mercurial、bazaar和svn仓库,因此您自己的Git服务器、Bitbucket、GitLab等都是可以接受的。文档中有相关介绍:https://golang.org/doc/code.html#PackagePaths
类似地,您可以只创建一个$GOPATH/src/yourname/yourpkg
目录,但是与他人共享代码会更加困难。
此外,您还可以使用远程导入路径(也称为"vanity domains")来允许使用go get scott.com/pkg/usefulthing
而不是直接指向GitHub等。这样可以避免将来受限于单一平台,如果您希望迁移的话。
英文:
go get
supports most git, mercurial, bazaar & svn repos, so your own Git server, Bitbucket, GitLab, etc are all acceptable. This is touched on in the docs here: https://golang.org/doc/code.html#PackagePaths
Similarly, you can just create a $GOPATH/src/yourname/yourpkg
dir, but you will have a harder time sharing your code with others.
In addition, you can use remote import paths (aka "vanity domains") to allow go get scott.com/pkg/usefulthing
instead of directly pointing to GitHub, etc. Useful as you can avoid being tied to a single platform, should you wish to move in the future.
答案2
得分: 3
"go get"和"import"语句都支持多个远程仓库,包括:
- Bitbucket(Git,Mercurial)
- GitHub(Git)
- Launchpad(Bazaar)
- IBM DevOps Services(Git)
同时,它们还支持在其他服务器上托管的代码的语法:
对于在其他服务器上托管的代码,导入路径可以使用版本控制类型进行限定,或者go工具可以通过https/http动态获取导入路径,并从HTML中的标签中发现代码所在位置。
为了声明代码位置,导入路径的格式为
repository.vcs/path
指定给定的仓库,可以带有或不带有.vcs后缀,使用指定的版本控制系统,然后是该仓库内的路径。支持的版本控制系统有:
- Bazaar .bzr
- Git .git
- Mercurial .hg
- Subversion .svn
英文:
"go get" and the "import" statement both support several remote repositories, including:
- Bitbucket (Git, Mercurial)
- GitHub (Git)
- Launchpad (Bazaar)
- IBM DevOps Services (Git)
as well as syntax for code hosted on other servers:
> For code hosted on other servers, import paths may either be qualified
> with the version control type, or the go tool can dynamically fetch
> the import path over https/http and discover where the code resides
> from a <meta> tag in the HTML.
>
> To declare the code location, an import path of the form
>
> repository.vcs/path specifies the given repository, with or without
> the .vcs suffix, using the named version control system, and then the
> path inside that repository. The supported version control systems
> are:
>
> - Bazaar .bzr
> - Git .git
> - Mercurial .hg
> - Subversion .svn
答案3
得分: 3
你不需要自己在Github上注册账号就可以使用Github上其他可用的仓库。Bitbucket提供无限制的私有仓库。你甚至可以选择完全本地的git仓库(不使用任何git托管服务),仍然可以使用Github上的仓库。
英文:
You don't need to be on Github yourself to use other available repos on Github. Bitbucket offers unlimited private repositories. You can even choose to have a completely local git repository (not using any git hosting service), and still use repos available on Github.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论