一、golang之旅--gopm
1.什么是gopm

在nodejs中我们有npm,可以通过npm来下载安装一些依赖包。在go中也开发了类似的东西,那就是gopm。这玩意儿是七牛开发的。在这里说下,七牛公司大部分程序都是用go语言编写的,所以开发出这么一个方便的东西肯定也是合情合理的。

2.gopm地址

git地址:https://github.com/gpmgo/gopm
官方地址:https://gopm.io/gopm
文档路径:https://github.com/gpmgo/docs/tree/master/zh-CN

3.gopm安装

go get -u github.com/gpmgo/gopm
通过这个命令来安装插件,默认的会存放到GOBIN,如果没有配置%GOBIN%环境变量,那么会默认安装到%GOPATH%下的bin目录,为了我们操作方便,我们把GOBIN加到%PATH%下。

4.gopm get

通过gopm get xxx,可以将指定的包下载到gopm的本地仓库~/.gopm/repos(建议使用) 通过'gopm get -g xxx',可以将指定的包下载到GOPATH下。(建议使用) 通过'gopm get -l xxx',可以将指定的包下载到当前所在目录(不常用)

二、国内的go get问题的解决

用gopm get -g代替go get
不采用-g参数,会把依赖包下载.vendor目录下面;
采用-g 参数,可以把依赖包下载到GOPATH目录中;

gopm get -g golang.org/x/net

国内的go get问题的解决 --gopm的更多相关文章

  1. 转 国内的go get问题的解决

    转 国内的go get问题的解决     go get golang.org/x 包失败解决方法 由于各种问题,国内使用 go get 安装 golang 官方包可能会失败,如我自己在安装 colli ...

  2. IOS LocationManager定位国内偏移,火星坐标(GCJ-02)解决方法

    转载自:http://blog.csdn.net/swingpyzf/article/details/16972351 纠偏也可参考:http://www.2cto.com/kf/201310/253 ...

  3. 国内的go get问题的解决

    在国内采用go get有时会下载不到一些网站如golang.org的依赖包. 方法1(亲测有效): gopm 代替go 下载第三方依赖包可以采用gopm从golang.org一些镜像网站上下载. 注意 ...

  4. Python国内镜像源及报错解决方法

    国内镜像源: 阿里云:https://mirrors.aliyun.com/pypi/simple/ 清华:https://pypi.tuna.tsinghua.edu.cn/simple/ 中国科技 ...

  5. go爬虫系列

    一.go语言爬取豆瓣电影top250 package main import ( "net/http" "io/ioutil" "os" & ...

  6. 转载: 国内的go get无法连接问题的解决

    转载自CSDN的文章 https://blog.csdn.net/gongpulin/article/details/80972806 国内的go get问题的解决 go get golang.org ...

  7. 解决:insert Vodafone sim card,open the mms read report,when receive the read report,cann't download..

    insert Vodafone sim card,open the mms read report,when receive the read report,cann't download the m ...

  8. 瑞星推国内唯一Linux系统杀毒软件 国产操作系统还需国产安全软件保护

    近来在IT领域最爆炸的新闻莫过于5月20日中央国家机关政府採购中心下发通知.要求中央机关採购所有计算机类产品不同意安装Windows 8.而改用国产Linux操作系统. 此消息一出,立马引起各界关注. ...

  9. Bootstrap.css 中请求googleapis.com/css?family 备忘录

    问题描述: Web中引入bootstrap.css中头部有访问Google服务器的请求 @import url("//fonts.googleapis.com/css?family=Open ...

随机推荐

  1. luogu P2899 [USACO08JAN]手机网络Cell Phone Network |贪心

    include include include include include include define db double using namespace std; const int N=1e ...

  2. zuul+security跨域Cors问题解决

    zuul+security跨域Cors问题解决 简介 场景 在服务后台都会出现跨域cors问题,不过一般spring解决起来比较方便,在框架+框架的基础上,问题就显得特别明显了,各种冲突,不了解源码的 ...

  3. MVC异常处理

    处理局部异常 控制器: @Controller @RequestMapping("/ex") public class ExceptionController { @Excepti ...

  4. [TimLinux] Python 元类

    1. type函数 name = "This is a string" print(type(name)) # <class 'str'> print("*& ...

  5. HDU1907 Jhon

    Little John is playing very funny game with his younger brother. There is one big box filled with M& ...

  6. Koa - 初体验(写个接口)

    前言 不会node.js的前端不是一个好前端! 这几年node.js确实是越来越火了,好多公司对node.js都开始有要求.虽说前端不一定要会后端,但想要成为一个优秀的前端,node.js是必经之路. ...

  7. Spring Boot 外部化配置(一)- Environment、ConfigFileApplicationListener

    目录 前言 1.起源 2.外部化配置的资源类型 3.外部化配置的核心 3.1 Environment 3.1.1.ConfigFileApplicationListener 3.1.2.关联 Spri ...

  8. Day 05 作业

    目录 作业 输入姑娘的年龄后,进行以下判断: 复习while循环,打印1-100之间的奇数和 复习while循环,猜年龄游戏升级版,有以下三点要求: 作业 输入姑娘的年龄后,进行以下判断: 如果姑娘小 ...

  9. 用递归实现N!

    def digui(n): result = 1 if n == 2: result = 2 elif n > 2: result = n* digui(n-1) print(result) r ...

  10. Java String 如何加双引号

    public class Test{ public static void main(String[] args){ String str1 = "\"name\"&qu ...