Closed nzlov closed 5 years ago
The issue has been resolved,Don't set $GOBIN.But Why?
I had this issue a few weeks ago and since I installed Go directly from src
. This json
-Blob below demonstrates how I had to adjust my GoSublime User settings.
{
"env": {
"GOPATH": "$HOME/.golang",
"GOROOT": "$HOME/.go"
}
}
Explanation:
I cloned the Golang git repository to ~/.go and built (installed) it from there.
My Golang projects, packages and binaries reside in ~/.golang/{pkg,src,bin}
.
This settings coincide with the settings of my bash
environment:
# Setup Go
export GOROOT=$HOME/.go
export GOPATH=$HOME/.golang
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
I hope this helps.
Run go env
to get go env settings, and by doing that, you will find the correct value for $GOROOT
.
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH=""
GORACE=""
GOROOT="/usr/local/homebrew/Cellar/go/1.4.2/libexec"
GOTOOLDIR="/usr/local/homebrew/Cellar/go/1.4.2/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
Then set $GOPATH
to the directory you want. Build will work after that.
Had the same issue. My $GOROOT was wrong. :)
| GoSublime error: MarGo build failed | > This is possibly a bug or miss-configuration of your environment. | > For more help, please file an issue with the following build output | > at: https://github.com/DisposaBoy/GoSublime/issues/new | > or alternatively, you may send an email to: gosublime@dby.me | > | > | > cmd:
['', 'build', '-v', '-x', '-o', 'gosublime.margo_r14.12.06-1_devel+256116a.exe', 'gosubli.me/margo']
| > stdout:| > stderr:
| > exception:Cannot find command
go` | install state: busy | sublime.version: 3065 | sublime.channel: stable | about.ann: a14.02.25-1 | about.version: r14.12.06-1 | version: r14.12.06-1 | platform: osx-x64 | ~bin: ~/Library/Application Support/Sublime Text 3/Packages/User/GoSublime/osx-x64/bin | margo.exe: ~bin/gosublime.margo_r14.12.06-1_devel+256116a.exe (ok) | go.exe: ~/mac/workspace/go/bin/go (ok) | go.version: devel+256116a | GOROOT: ~/program/go | GOPATH: ~/mac/workspace/go | GOBIN: ~/mac/workspace/go/bin (should usually be
(not set)`) | set.shell: [] | env.shell: /bin/bash | shell.cmd: ['/bin/bash', '-l', '-c', '${CMD}']