go语言渐入佳境[49]-解决下载go语言包翻墙问题

简介

国内用户在下载go语言包的时候,常常会面临翻墙问题,这里介绍的gopm工具可以解决这一问题。

网址:https://github.com/gpmgo/gopm

简单使用方法:go get -u github.com/gpmgo/gopm

执行文件将会产生在$Gopath/bin目录中。将此目录设置为PATH变量

使用方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
NAME:
Gopm - Go Package Manager

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

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

例子:

1
2
> gopm get -g -v golang.org/x/text
> gopm get -g -v golang.org/x/net/html