gopm解决golang国内无法go get获取第三方包的问题

gopm介绍

提供go依赖包的下载工具

gopm地址

官方地址:https://gopm.io

gopm安装

go get -v github.com/gpmgo/gopm
go install github.com/gpmgo/gopm

gopm参数说明

NAME:
   Gopm - Go Package Manager

USAGE:
   Gopm [global options] command [command options] [arguments...]

VERSION:
   0.8.8.0307 Beta

COMMANDS:
   list         list all dependencies of current project
   gen          generate a gopmfile for current Go project
   get          fetch remote package(s) and dependencies
   bin          download and link dependencies and build binary
   config       configure gopm settings
   run          link dependencies and go run
   test         link dependencies and go test
   build        link dependencies and go build
   install      link dependencies and go install
   clean        clean all temporary files
   update       check and update gopm resources including itself
   help, h      Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --noterm, -n         disable color output
   --strict, -s         strict mode
   --debug, -d          debug mode
   --help, -h           show help
   --version, -v        print the version

使用gopm get代替go get 其他参数和go get差不多,可以参考上面的参数说明

gopm使用

gopm get -g golang.org/x/sys

在这里插入图片描述
可以在GOPATH下看到我们下载到了 golang.org/x/sys 这个包,正常国内用go get是无法下载到该依赖包的,而gopm get却可以
不采用-g参数,会把依赖包下载.vendor目录下面;
采用-g 参数,会把依赖包下载到GOPATH目录中(建议使用);

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值