read-only file system issue with snap installed golang
i have installed golang 1.11 with snap on ubuntu 18.04 and set /etc/environment to: GOROOT="/snap/go/current"
Each time i want to save a project, go-plus trys to execute:
Compiling tests:
$ go test -c -i -o /dev/null .
The following error is shown:
go test runtime/cgo: open /snap/go/current/pkg/linux_amd64/runtime/cgo.a: read-only file system
The problem seems to be the -i . Is there a way to remove this parameter?
Go env:
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ms/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ms/go"
GOPROXY=""
GORACE=""
GOROOT="/snap/go/2635"
GOTMPDIR=""
GOTOOLDIR="/snap/go/2635/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-I/opt/ibm/clidriver/include"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-L/opt/ibm/clidriver/lib"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build986615010=/tmp/go-build -gno-record-gcc-switches"
when i remove the -i in https://github.com/joefitzgerald/go-plus/blob/master/lib/build/builder.js#L204
it works well! The -i should be configurable, i dont need to install each time.
go install -i fails with the same reason, just go install works fine.
I have the same issue with go-code-check :
Finished running tool: /snap/go/3129/bin/go build -i -o /tmp/vscode-govKdVwR/go-code-check github.com/Sach97/gqlgenauth/examples/gqlgen-todos-auth
go build net: open /snap/go/3129/pkg/linux_amd64/net.a: read-only file system
Edit : @mschneider82 solved this by running "go.installDependenciesWhenBuilding":false in my vscode settings