教程集 www.jiaochengji.com
教程集 >  Golang编程  >  golang教程  >  正文 gopm解决golang国内无法go get获取第三方包的问题

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

发布时间:2022-02-17   编辑:jiaochengji.com
教程集为您提供gopm解决golang国内无法go get获取第三方包的问题等资源,欢迎您收藏本站,我们将为您提供最新的gopm解决golang国内无法go get获取第三方包的问题资源
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"/></svg><h3>gopm介绍</h3>

提供go依赖包的下载工具

<h3>
gopm地址</h3>

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

<h3>
gopm安装</h3> <pre><code>go get -v github.com/gpmgo/gopm go install github.com/gpmgo/gopm </code></pre> <h3>gopm参数说明</h3> <pre><code>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 </code></pre>

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

<h3>
gopm使用</h3> <pre><code>gopm get -g golang.org/x/sys </code></pre>


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

到此这篇关于“gopm解决golang国内无法go get获取第三方包的问题”的文章就介绍到这了,更多文章或继续浏览下面的相关文章,希望大家以后多多支持JQ教程网!

您可能感兴趣的文章:
gopm解决golang国内无法go get获取第三方包的问题
Golang微服务micro 环境搭建,纯小白..
go get 无法从golang下载安装依赖的三方库
Golang: 安装配置
Golang笔记:包管理机制
Golang:国内 go get 无法下载的问题
golang 包管理工具
Golang包管理详解
GOPROXY:解决 go get golang.org/x 包失败
golang https 代理_goproxy.cn - 为中国 Go 语言开发者量身打造的模块代理

上一篇:Golang简介 下一篇:go语言类型和接口
[关闭]
~ ~