go version)?$ go version go version go1.12.2 darwin/amd64
go env)?go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/alessandro.cinelli/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/alessandro.cinelli/code/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/5c/mf41njn51wlb8qlgxx0cgy08nkjrh6/T/go-build073477119=/tmp/go-build -gno-record-gcc-switches -fno-common"
I installed the go tour via go get golang.org/x/tour
A browser opening go tour
2019/04/21 21:35:05 Couldn't find tour files: could not find go-tour content; check $GOROOT and $GOPATH
I guess I found the issue: I had to turn off GO111MODULE
export GO111MODULE=off
is that expected? What would be the right way to install tour with GO111MODULE=on?
In module mode, binaries are installed in $GOBIN or $GOPATH/bin
https://golang.org/cmd/go/#hdr-Environment_variables
https://golang.org/cmd/go/#hdr-GOPATH_and_Modules
Feel free to reach out to the forums in https://github.com/golang/go/wiki/Questions for further questions.
With export GO111MODULE=off set, I'm still getting
Couldn't find tour files: could not find go-tour content; check $GOROOT and $GOPATH
I'm new to golang. Wondering if this is an issue for go-tour.
Solved: Oh I ran the go get golang.org/x/tour in a go module directory. Running the go get in a non-go-module directory solved the issue.
Following this guide(in Chinese) , you should copy files from $GOPATH/pkg/mod/golang.org/x/tour@VERSIONINFO to $GOPATH/src/golang.org/x/tour.
Use this script in Powershell if you like:
Copy-Item -Force -Recurse -Container $env:GOPATH\pkg\mod\golang.org\x\tour@*\* $env:GOPATH/src/golang.org/x/tour/
Most helpful comment
With
export GO111MODULE=offset, I'm still gettingI'm new to golang. Wondering if this is an issue for go-tour.
Solved: Oh I ran the
go get golang.org/x/tourin a go module directory. Running thego getin a non-go-module directory solved the issue.