Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

go get command does not provide output nor take effect

Tags:

go

I have installed go on my mac

go version

output:

go version go1.8.1 darwin/amd64

AND

go env

output:

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"

when I ran the following go get command:

go get -v github.com/miku/esbulk/cmd/esbulk

it neither generating any output nor does anything. Just nothing happened.

Update 1

in GOPATH/pkg folder there is darwin_amd64 folder, in darwin_amd64 folder there is

github.com/miku/esbulk.a
like image 405
Hello lad Avatar asked May 01 '17 10:05

Hello lad


People also ask

What go GET command do?

Go The Go Command Go Get go get downloads the packages named by the import paths, along with their dependencies. It then installs the named packages, like 'go install'. Get also accepts build flags to control the installation.

Where to run go get command?

Executable is installed in the directory named by the GOBIN environment variable which defaults to $GOPATH/bin or $HOME/go/bin if the GOPATH environment variable is not set. In this article, we will install a package using the go get command.

Is go get deprecated?

go get 's ability to build and install commands is now deprecated, since that functionality is redundant with go install .


1 Answers

$ 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.

$ 

If there is nothing to do then there is nothing to report. For example, when go get is run for the first time it downloads and installs, after that it does nothing because there is nothing to do, unless you force an update:

$ 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 
$ 
like image 135
peterSO Avatar answered Oct 12 '22 20:10

peterSO