Go: cannot run gomobile

Created on 31 Aug 2016  路  5Comments  路  Source: golang/go

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.6.3

What operating system and processor architecture are you using (go env)?

darwin

What did you do?

I tried to install gomobile as follow:

$ go get golang.org/x/mobile/cmd/gomobile
$ gomobile init

What did you expect to see?

What did you see instead?

when i run gomobile init, i get "-bash: gomobile: command not found" as response

FrozenDueToAge

Most helpful comment

You can try like below

export PATH=$PATH:$HOME/go/bin

I had issues with the $GOPATH var and this worked for me

All 5 comments

It seems that you didn't add GOPATH/bin to your PATH
add a line in your .bash_profile or .zshrc:
export PATH=$PATH:$GOPATH/bin
and the reopen the terminal

@raphael10241024 it works.thks

@raphael10241024 please help me

longtran@longtran:~$ gomobile init
gomobile: command not found
longtran@longtran:~$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/longtran/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build122730492=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
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"
longtran@longtran:~$ gomobile init
gomobile: command not found

You can try like below

export PATH=$PATH:$HOME/go/bin

I had issues with the $GOPATH var and this worked for me

@ragavendra, thank you, sir. Worked for me.

Was this page helpful?
0 / 5 - 0 ratings