zoukankan      html  css  js  c++  java
  • go包管理工具glide

    go环境

    参考 https://www.cnblogs.com/liujitao79/p/8391398.html
    

    安装dep

    curl https://glide.sh/get | sh
    
    or 
    
    go get -u -v github.com/Masterminds/glide
    

    新项目初始化

    # cd $GOPROJECT/src
    # git clone https://github.com/liujitao/learning_go.git github.com/liujitao/learning_go
    # cd github.com/liujitao/learning_go
    
    # glide init
    

    添加第三方依赖包

    # glide get github.com/emicklei/go-restful#~2.8.0
    # glide get github.com/mattn/go-sqlite3
    
    # cat glide.yaml
    package: .
    import:
    - package: github.com/emicklei/go-restful
      version: ~2.8.0
    - package: github.com/mattn/go-sqlite3
      version: ~1.9.0
    

    其他命令

    USAGE:
       glide [global options] command [command options] [arguments...]
    
    VERSION:
       v0.13.1
    
    COMMANDS:
         create, init       Initialize a new project, creating a glide.yaml file
         config-wizard, cw  Wizard that makes optional suggestions to improve config in a glide.yaml file.
         get                Install one or more packages into `vendor/` and add dependency to glide.yaml.
         remove, rm         Remove a package from the glide.yaml file, and regenerate the lock file.
         import             Import files from other dependency management systems.
         name               Print the name of this project.
         novendor, nv       List all non-vendor paths in a directory.
         rebuild            Rebuild ('go build') the dependencies
         install, i         Install a project's dependencies
         update, up         Update a project's dependencies
         tree               (Deprecated) Tree prints the dependencies of this project as a tree.
         list               List prints all dependencies that the present code references.
         info               Info prints information about this project
         cache-clear, cc    Clears the Glide cache.
         about              Learn about Glide
         mirror             Manage mirrors
         help, h            Shows a list of commands or help for one command
    

    对于被墙的站点使用镜像

    原版不支持下层路径
    # glide mirror set https://golang.org/x/net https://github.com/golang/net.git --vcs git
    [INFO]	No mirrors.yaml file exists. Creating new one
    [INFO]	https://golang.org/x/net being set to https://github.com/golang/net.git
    [INFO]	mirrors.yaml written with changes
    
    # glide mirror set https://golang.org/x/sys https://github.com/golang/sys.git --vcs git
    [INFO]	https://golang.org/x/sys being set to https://github.com/golang/sys.git
    [INFO]	mirrors.yaml written with changes
    
    
    需使用 https://github.com/xkeyideal/glide.git 这个hack版本
    
    go get -u -v github.com/xkeyideal/glide 
    go install -u -v github.com/xkeyideal/glide 
    
    # glide mirror set https://golang.org/x/net/websocket https://github.com/golang/net.git --base golang.org/x/net
    # glide mirror set https://golang.org/x/sys/unix https://github.com/golang/sys.git --base golang.org/x/sys
    
  • 相关阅读:
    js动态添加select菜单 联动菜单
    用户控件的缓存技术之一【共三篇】
    删除根节点下的所有子节点
    兼容FF和IE的tooltip 鼠标提示框
    【ABAP系列】SAP ABAP常用正则表达式大全
    【ABAP系列】SAP ABAP中关于commit的一点解释
    【SD系列】SAP SD模块-创建供应商主数据BAPI
    【SQL系列】从SQL语言的分类谈COMMIT和ROLLBACK的用法
    【ABAP系列】SAP ABAP控制单元格是否可编辑
    【ABAP系列】SAP ABAP 关于BAPI的EXTENSIONIN 一点解释
  • 原文地址:https://www.cnblogs.com/liujitao79/p/9287784.html
Copyright © 2011-2022 走看看