I'm using Visual Studio code to write some go code. Everything was working fine yesterday, but now I can't run the debugger or build in VS-Code.
I am on Windows 10, and I use Powershell as my terminal of choice.
I get the following error:
go: GOPATH entry is relative; must be absolute path: "/Users/efronlicht/go".
For more details see: 'go help gopath'
exit status 2
Process exiting with code: 1
This is a VS-CODE specific error, because I can build go source files with go build
through the terminal as usual.
Here are the results of go env
:
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\work\go
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
As you can see, my GOPATH is an absolute path, not a relative one.