This question has been answered here but in my case , this isn't working. It may be because of new VS code version. My Steps:
- Installed plugin
In command window
ctrl+shift+P
, enteredGo: Install/Update Tools
and installed all 17 packagesBut I am getting the error. here is the dir structure:
- My
go env
output fromcmd
:
D:\Personal\Learning\GoLang\Project-1>go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\rog1\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Go\bin;D:\Personal\Learning\GoLang\Project-1;
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\rog1\AppData\Local\Temp\go-build020393970=/tmp/go-build -gno-record-gcc-switches
go : The term 'go' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1 + go env
+~~
- CategoryInfo : ObjectNotFound: (go:String) [], CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException
My
PATH
environment variable :C:\Go\bin;
My
VS Code
setting.json
entry:
"go.autocompleteUnimportedPackages": true,
"go.gopath": "D:\\Personal\\Learning\\GoLang\\Project-1\\",
"go.goroot": "C:\\Go\\",
What am I missing ?