Glide--Golang包版本管理工具
Golang挺好用的,但是目前比较受到诟病的是其没有自带包管理工具(golang社区已经发起了一个dep的项目,不过要正式被golang接受还需要一段时间)。官方没有咋办,那就自己造轮子呗。所以 go的包管理工具就五花八门、层出不穷了。目前有Glide,gopm,godep,gpm,gom等等。。。 这里介绍一个工具,使用比较简单: glide 我已经将其文档翻译成了中文: glide 中文文档. 翻译的内容放在github上: https://github.com/javasgl/GlideDocs. 国内的访问github不顺畅的同学们,请看码云:http://git.oschina.net/javasgl/GlideDocs 不想看文章的可以直接去看中文文档,文档写的很清晰,文档中关于 安装安装就没啥可以说的了,去下载安装即可了(http://glidedocs.readthedocs.io/zh/latest/#glide) 初始化在你已有的go项目的根目录下直接运行: ~/codes/xxxxx/xxxx/: glide init [INFO] Generating a YAML configuration file and guessing the dependencies [INFO] Attempting to import from other package managers (use --skip-import to skip) [INFO] Scanning code to look for dependencies [INFO] --> Found reference to github.com/astaxie/beego [INFO] --> Found reference to github.com/stretchr/testify/assert [INFO] --> Found reference to gopkg.in/olivere/elastic.v3 .... 运行完成之后, package: . import: - package: github.com/astaxie/beego - package: github.com/stretchr/testify subpackages: - assert - package: gopkg.in/olivere/elastic.v3 添加依赖运行 ~/cods/xxxx/xxxx/:glide get https://github.com/garyburd/redigo .... 完成之后, package: . import: - package: github.com/astaxie/beego - package: github.com/stretchr/testify subpackages: - assert - package: gopkg.in/olivere/elastic.v3 - package: github.com/grayburd/redigo 更新依赖运行 ~/cods/xxxx/xxxx/:glide up [INFO] Downloading dependencies. Please wait... [INFO] --> Fetching github.com/stretchr/testify. [INFO] --> Fetching gopkg.in/olivere/elastic.v3. [INFO] --> Fetching github.com/astaxie/beego. .... 其他命令其他的一些命令主要是帮助管理这些依赖的。详细见 http://glidedocs.readthedocs.io/zh/latest/commands/ 写在最后欢迎大家 star,提交 issue 或者 fork 提交 pull request 来帮助我改进翻译质量。翻译项目地址: https://github.com/javasgl/GlideDocs (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |