{"action":"opened","issue":{"url":"https://api.github.com/repos/AbelLai/What-I-Will-Say/issues/8","repository_url":"https://api.github.com/repos/AbelLai/What-I-Will-Say","labels_url":"https://api.github.com/repos/AbelLai/What-I-Will-Say/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/AbelLai/What-I-Will-Say/issues/8/comments","events_url":"https://api.github.com/repos/AbelLai/What-I-Will-Say/issues/8/events","html_url":"https://github.com/AbelLai/What-I-Will-Say/issues/8","id":145512392,"number":8,"title":"Go Package Manager","user":{"login":"AbelLai","id":2275531,"avatar_url":"https://avatars.githubusercontent.com/u/2275531?v=3","gravatar_id":"","url":"https://api.github.com/users/AbelLai","html_url":"https://github.com/AbelLai","followers_url":"https://api.github.com/users/AbelLai/followers","following_url":"https://api.github.com/users/AbelLai/following{/other_user}","gists_url":"https://api.github.com/users/AbelLai/gists{/gist_id}","starred_url":"https://api.github.com/users/AbelLai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbelLai/subscriptions","organizations_url":"https://api.github.com/users/AbelLai/orgs","repos_url":"https://api.github.com/users/AbelLai/repos","events_url":"https://api.github.com/users/AbelLai/events{/privacy}","received_events_url":"https://api.github.com/users/AbelLai/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/AbelLai/What-I-Will-Say/labels/Golang","name":"Golang","color":"e6e6e6"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-03T15:43:56Z","updated_at":"2016-04-03T15:43:56Z","closed_at":null,"body":"目前，Golang并没有一个官方的包管理器。而是把这种方式留给了用户。目前，社区有几个关注度比较高的包管理。同时，Golang也在其官方网站里面把它们列了出来，推荐用户根据自己的喜好选择。\r\n\r\n在那些实现里面，我个人比较喜欢gom。在我看来，gom像是Ruby的Rubygem和Node.js的NPM的结合体。\r\n\r\ngom，操作起来也蛮方便的。\r\n\r\n1. 进入自己本地环境的工作目录（也就是自己配置的$GOPATH的路径）把gom给setup起来`go get github.com/mattn/gom`\r\n2. 创建自己的项目文件夹，然后创建一个main.go文件（gom要求项目文件里面需要一个这样的文件）\r\n3. 创建Gomfile文件（跟Rubygem的Gemfile很像吧？）：`gom gen gomfile`。\r\n4. Gomfile里面引入包的方式与Gemfile的也很像，例如：`gom 'github.com/abellai/gmvc'`。\r\n5. `gom install`便会把那些依赖包下载下来了。\r\n\r\n跟原来官方默认的配置方式有点不一样的是，gom会在项目目录下创建一个_vendor的文件来存放pkg和src。这种方式就像Node.js的NPM会在项目目录下创建一个node_modules一样。\r\n\r\n所以，gom这种方式还是挺方便简单的。这样，我们不用创建多个GOPATH了。\r\n\r\n\r\n\r\n\r\n\r\n"}}