-2

I'm following this link to install and manage multiple versions of go in my ubuntu container. When I try to execute the command go install golang.org/dl/go1.10.7@latest, I get this error

can't load package: package golang.org/dl/go1.10.7@latest: can only use path@version syntax with 'go get'

I also tried with go get golang.org/dl/go1.10.7@latest, this exits just after printing below line go: finding golang.org/dl latest without downloading.

I also tried skipping the latest tag in go install command, this exits without any message and the version not installed. Has anyone succeeded in installing different versions of golang in ubuntu container?

1 Answers1

-1

Open ~/.bash_profile then add:

$ export GOPATH=$HOME/go
$ export GOBIN=$HOME/go/bin

Then run:

source ~/.bash_profile

Try to run the command to install go:

go install golang.org/dl/go1.10.7@latest

Source: SettingGOPATH

miftahulrespati
  • 494
  • 4
  • 16