zoukankan      html  css  js  c++  java
  • golang包管理的取巧

    常见的golang的包管理工具

    • glide 使用yaml做配置,语义化版本管理,可以设置镜像,下载x系列库,但是x系列库被第三方库依赖时会出现下载失败。

    • dep 亲儿子,语义化版本管理,无法解决墙

    • vgo 亲儿子为了解决语义化版本和导入版本的问题 ,没研究,猜测也无法解决墙

    • gvt 和go get 一样,只是下载到了vendor目录

    经过一段时间的折腾后,发现还是gvt 最好用,虽然没有什么语义化版本,但是好处是可以设置镜像,而且没有glide中x系列库被依赖而无法下载的问题。

    解决方案

    使用gvt,并把vendor下的gvt配置文件manifest加入git仓库,这样其他人可以使用gvt restore恢复
    常用的x系列库配置为:

           {
    			"importpath": "golang.org/x/crypto",
    			"repository": "https://github.com/golang/crypto",
    			"vcs": "git",
    			"revision": "",
    			"branch": "master",
    			"notests": true
    		},
    		{
    			"importpath": "golang.org/x/image",
    			"repository": "https://github.com/golang/image",
    			"vcs": "git",
    			"revision": "",
    			"branch": "master",
    			"notests": true
    		},
    		{
    			"importpath": "golang.org/x/net",
    			"repository": "https://github.com/golang/net",
    			"vcs": "git",
    			"revision": "",
    			"branch": "master",
    			"notests": true
    		},
    		{
    			"importpath": "golang.org/x/sync",
    			"repository": "https://github.com/golang/sync",
    			"vcs": "git",
    			"revision": "",
    			"branch": "master",
    			"notests": true
    		},
    		{
    			"importpath": "golang.org/x/sys",
    			"repository": "https://github.com/golang/sys",
    			"vcs": "git",
    			"revision": "",
    			"branch": "master",
    			"notests": true
    		},
    		{
    			"importpath": "golang.org/x/text",
    			"repository": "https://github.com/golang/text",
    			"vcs": "git",
    			"revision": "",
    			"branch": "master",
    			"notests": true
    		}
    
    
  • 相关阅读:
    修改CentOS的yum源为国内yum镜像源
    CentOS7利用yum安装node.js
    Ansible系列(一):安装
    动态链接库引起的yum故障
    《C++ Templates: The Complete Guide》读书笔记
    Linux下编译clang、libcxx及其相关库——C++11环境搭建
    shell小工具:findstr 和 findfile
    关于newexpression、new operator、operator delete的总结
    Makefile编写示例:构建一个库
    无计划就不行动!
  • 原文地址:https://www.cnblogs.com/xdao/p/golang_package.html
Copyright © 2011-2022 走看看