go get命令不提供输出也不生效

时间:2017-05-01 10:40:53

标签: go

我已经安装了我的Mac

go version

输出:

go version go1.8.1 darwin/amd64

go env

输出:

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/MYUSERNAME/go/"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/np/ts5bwp_91ns22l9h751h2j8r0000gn/T/go-build124313959=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

当我运行以下go get命令时:

go get -v github.com/miku/esbulk/cmd/esbulk
它既不产生任何输出也不做任何事情。什么也没发生。

更新1

在GOPATH / pkg文件夹中有darwin_amd64文件夹,在darwin_amd64文件夹中有

github.com/miku/esbulk.a

2 个答案:

答案 0 :(得分:4)

$ go help get
usage: go get [-d] [-f] [-fix] [-insecure] [-t] [-u] [build flags] [packages]

Get downloads the packages named by the import paths, along with their
dependencies. It then installs the named packages, like 'go install'.

The -u flag instructs get to use the network to update the named packages
and their dependencies.  By default, get uses the network to check out
missing packages but does not use it to look for updates to existing packages.

The -v flag enables verbose progress and debug output.

$ 

如果无事可做,则无需报告。例如,当第一次运行go get时它会下载并安装,之后它什么都不做,因为除非你强行更新,否则无所事事:

$ go get -v github.com/aclements/perflock/cmd/perflock 
github.com/aclements/perflock (download)
github.com/aclements/perflock/internal/cpupower
github.com/aclements/perflock/cmd/perflock
$ go get -v github.com/aclements/perflock/cmd/perflock 
$ go get -v github.com/aclements/perflock/cmd/perflock 
$ go get -v -u github.com/aclements/perflock/cmd/perflock 
github.com/aclements/perflock (download)
$ go get -v -u github.com/aclements/perflock/cmd/perflock 
github.com/aclements/perflock (download)
$ go get -v github.com/aclements/perflock/cmd/perflock 
$ go get -v github.com/aclements/perflock/cmd/perflock 
$ 

答案 1 :(得分:0)

我确定您现在已经解决了该问题,但是如果可以解决其他问题,您可以检查一下“ $ GOTOOLDIR”(将要安装“ go get”的地方)。

类型

go env

并检查您的GOTOOLDIR是否是您想要安装go的地方。