I'm trying to run Go
in an interactive mode.
I want to use go-eval
for that, I followed their README
instructions:
go get github.com/sbinet/go-eval/
successfullygo-eval
which resulted in -bash: go-eval: command not found
Some more information:
echo $PATH
returns: /usr/local/go/bin:...
echo $GOPATH
returns: $HOME/golang
running whereis go-eval
returns no output
running go install go-eval
returns:
can't load package: package go-eval: cannot find package "go-eval" in any of: /usr/local/go/src/go-eval (from $GOROOT) $HOME/golang/src/go-eval (from $GOPATH)
Go The Go Command Go Getgo 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. When checking out a new package, get creates the target directory $GOPATH/src/<import-path> .
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.
Much like the previous behaviour of go get , go install places binaries in $GOPATH/bin , or in $GOBIN if set.
You'll need to add GOPATH/bin
to PATH
.
PATH="$GOPATH/bin:$PATH"
Update [Go 1.8 and above]: GOPATH
will default to $HOME/go
. The above will not work if GOPATH
is not explicitly set.
To set both, add this to your .profile
file:
export GOPATH="$HOME/go" PATH="$GOPATH/bin:$PATH"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With