dongsuiwo0279 2017-02-24 22:05
浏览 132

`go install`在Mac上不起作用

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/pkgfolder and re-run go get -v -x github.com/spf13/cobra/cobra.

The -xflag 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
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 基于PLC的三轴机械手程序
    • ¥15 多址通信方式的抗噪声性能和系统容量对比
    • ¥15 winform的chart曲线生成时有凸起
    • ¥15 msix packaging tool打包问题
    • ¥15 finalshell节点的搭建代码和那个端口代码教程
    • ¥15 Centos / PETSc / PETGEM
    • ¥15 centos7.9 IPv6端口telnet和端口监控问题
    • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 海浪数据 南海地区海况数据,波浪数据