What version of Go, VS Code & VS Code Go extension are you using?
- Run
go version to get version of Go
go version go1.15 darwin/amd64
- Run
code -v or code-insiders -v to get version of VS Code or VS Code Insiders
1.48.1 3dd905126b34dcd4de81fa624eb3a8cbe7485f13 x64
- Check your installed extensions to get the version of the VS Code Go extension
- Run
go env to get the go development environment details
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/andrea/Library/Caches/go-build"
GOENV="/Users/andrea/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/andrea/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/andrea/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/v7/p2rlmknn79g8l2772yyqnp6w0000gn/T/go-build964988215=/tmp/go-build -gno-record-gcc-switches -fno-common"
Share the Go related settings you have added/edited
"go.autocompleteUnimportedPackages": true,
"go.formatTool": "goimports"
Describe the bug
On MacOS, after having installed Go 1.15 from the official package and having configured PATH etc... if you try to create a new Go app with VSCode and auto build kick in (as it should), you get an error mentioning "/usr/local/go/pkg/darwin_amd64/runtime/cgo.a: permission denied"
I originally commented this bug golang/go#37962 but they mentioned this happens because VSCode Go extension still uses the -i option.
I was able to workaround the problem by running this sudo chown -R andrea /usr/local/go/pkg/darwin_amd64/ but I think it would be nice if this issue didn't happen at all.
Steps to reproduce the behavior:
- install Go 1.15 on MacOS using the official installer
- create a new project on VSCode with Go extension
- write any meaningful code that can compile
- you will see a red underlining below
package main (note: if you go build . the code compiles just fine).
Screenshots or recordings

Related issues
What version of Go, VS Code & VS Code Go extension are you using?
go versionto get version of Gogo version go1.15 darwin/amd64code -vorcode-insiders -vto get version of VS Code or VS Code Insiders1.48.1 3dd905126b34dcd4de81fa624eb3a8cbe7485f13 x64v0.16.1go envto get the go development environment detailsShare the Go related settings you have added/edited
Describe the bug
On MacOS, after having installed Go 1.15 from the official package and having configured PATH etc... if you try to create a new Go app with VSCode and auto build kick in (as it should), you get an error mentioning
"/usr/local/go/pkg/darwin_amd64/runtime/cgo.a: permission denied"I originally commented this bug golang/go#37962 but they mentioned this happens because VSCode Go extension still uses the
-ioption.I was able to workaround the problem by running this
sudo chown -R andrea /usr/local/go/pkg/darwin_amd64/but I think it would be nice if this issue didn't happen at all.Steps to reproduce the behavior:
package main(note: if yougo build .the code compiles just fine).Screenshots or recordings
Related issues