博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
go包管理工具glide
阅读量:4668 次
发布时间:2019-06-09

本文共 2777 字,大约阅读时间需要 9 分钟。

go环境

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

安装dep

curl https://glide.sh/get | shor 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.yamlpackage: .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.1COMMANDS:     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
posted on
2018-07-10 10:47 阅读(
...) 评论(
...)

转载于:https://www.cnblogs.com/liujitao79/p/9287784.html

你可能感兴趣的文章
Spring使用外部的配置文件
查看>>
ctype
查看>>
jsp 修饰 Request 及Response
查看>>
HDU 2389 Rain on your Parade / HUST 1164 4 Rain on your Parade(二分图的最大匹配)
查看>>
对象的类型转换P109
查看>>
sqlite 查询表和字段是否存在
查看>>
http => https 升级
查看>>
Window 分布式学习-好文收藏
查看>>
Android TextUtils类介绍
查看>>
linux echo设置颜色
查看>>
英文参考文献标准格式:论文参考文献格式规范(转载)
查看>>
css div框加小箭头
查看>>
Eclipse快捷键与使用技巧总结
查看>>
Solr4.8.0源码分析(16)之SolrCloud索引深入(3)
查看>>
PEP8 - Python编码规范
查看>>
div放置图片总结
查看>>
FZOJβ #45. 染色问题
查看>>
Python之SYS模块
查看>>
webapi文件上传和下载
查看>>
HDU 1540 Tunnel Warfare [二分 + 线段树]
查看>>