I wanted to install a Go binary with go install
. So I have downloaded the sources with
go get -v github.com/spf13/cobra/cobra
which gave me
$GOPATH/src
└── github.com
└── spf13
├── cobra
└── pflag
I created a $GOPATH/bin
directory. When I now run
go install github.com/spf13/cobra/cobra
(as stated in the documentation), nothing happens - there is no error message but after the command run, there is also no binary in $GOPATH/bin
.
Here is the output of my go env
GOARCH="amd64"
GOBIN="/Users/user/Workspace/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/user/Workspace/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.6/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.6/libexec/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
Any idea what's going wrong or how I can probably debug this? Thanks!
Edit
What solved the problem for me was to delete the $GOPATH/src
and $GOPATH/pkg
folder and re-run go get -v -x github.com/spf13/cobra/cobra
.
The -x
flag provides more output and as stated by @JimB it ended successfully with
mv $WORK/github.com/spf13/cobra/cobra/_obj/exe/a.out /Users/user/Workspace/go/bin/cobra