I am trying to build and install go from source code using this documentation. This works fine when I do like the following:
$ git clone https://go.googlesource.com/go goroot
$ cd goroot
$ git checkout master
$ cd src
$ ./all.bash`
Here I installed go from master branch. But when I checkout to another tag and try to execcute ./all.bash like following:
$ git clone https://go.googlesource.com/go goroot
$ cd goroot
$ git checkout go1.12
$ cd src
$ ./all.bash`
this gives me the folowing error:
go: cannot find main module, but found .git/config in /home/usr/goroot
to create a module there, run:
cd .. && go mod init`
I tried to do as the error message instructed i.e. go mod init , it gives me another error like the followig:
go: cannot determine module path for source directory /home/usr/goroot (outside GOPATH, module path must be specified)