You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
Run go version to get version of Go from the VS Code integrated terminal.
go version go1.20.2 darwin/amd64
Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
golang.org/x/tools/gopls v0.11.0
golang.org/x/tools/gopls@v0.11.0 h1:/nvKHdTtePQmrv9XN3gIUN9MOdUrKzO/dcqgbG6x8EY=
github.com/BurntSushi/toml@v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/google/go-cmp@v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/exp@v0.0.0-20221031165847-c99f073a8326 h1:QfTh0HpN6hlw6D3vu8DAwC8pBIwikq0AI1evdm+FksE=
golang.org/x/exp/typeparams@v0.0.0-20221031165847-c99f073a8326 h1:fl8k2zg28yA23264d82M4dp+YlJ3ngDcpuB1bewkQi4=
golang.org/x/mod@v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/sync@v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sys@v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/text@v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/tools@v0.3.1-0.20221213193459-ca17b2c27ca8 h1:7/HkGkN/2ktghBCSRRgp31wAww4syfsW52tj7yirjWk=
golang.org/x/vuln@v0.0.0-20221109205719-3af8368ee4fe h1:qptQiQwEpETwDiz85LKtChqif9xhVkAm8Nhxs0xnTww=
honnef.co/go/tools@v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=
mvdan.cc/gofumpt@v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
mvdan.cc/xurls/v2@v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.20.2
Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
1.77.3
1.78.0-insider
Check your installed extensions to get the version of the VS Code Go extension
v0.38.0
Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
gopath: /Users/kylereis/go
GOROOT: /usr/local/Cellar/go/1.20.2/libexec
PATH: /usr/local/opt/dirmngr/bin:/usr/local/sbin:/usr/local/bin:/Users/kylereis/go/bin:/usr/local/Cellar/go/1.20.2/libexec/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/share/dotnet:~/.dotnet/tools:/usr/local/git/bin:/usr/local/MacGPG2/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS
go: /usr/local/bin/go: go version go1.20.2 darwin/amd64
gotests: /Users/kylereis/go/bin/gotests (version: v1.6.0 built with go: go1.20.2)
gomodifytags: /Users/kylereis/go/bin/gomodifytags (version: v1.16.0 built with go: go1.20.2)
impl: /Users/kylereis/go/bin/impl (version: v1.1.0 built with go: go1.20.2)
goplay: /Users/kylereis/go/bin/goplay (version: v1.0.0 built with go: go1.20.2)
dlv: /Users/kylereis/go/bin/dlv (version: unknown - )
staticcheck: /Users/kylereis/go/bin/staticcheck (version: v0.4.3 built with go: go1.20.2)
gopls: /Users/kylereis/go/bin/gopls (version: v0.11.0 built with go: go1.20.2)
Share the Go related settings you have added/edited
Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.
None
Describe the bug
When VS Code is launched with a set but empty env var, it as unset when doing things like running tests and running the debugger. There was an issue open in the Vscode repo (microsoft/vscode#174330) but it has been closed as fixed, but I still have the issue. so I'm rporting here in case there is an issue in the extension too.
The environment variables should be treated as empty when running tests and the debugger.
Steps to reproduce the behavior:
Create a new go project
Create a new go file ex.go with the following content
I can reproduce this bug. It seems like the sort of thing that could happen when conflating e.g. "" and undefined in javascript, but I read the code starting with getTestEnvVars, and didn't spot the bug. Might need help debugging.
Looks like the root cause is somewhere deep in the stack microsoft/vscode#182560 (Chromium) which we cannot control unfortunately. FOO is lost way before the extension starts.
Closing since this is beyond the extension's control.
hyangah
added
Infeasible
Infeasible problem or feature request
and removed
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Sep 8, 2023
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
Run
go version
to get version of Go from the VS Code integrated terminal.Run
gopls -v version
to get version of Gopls from the VS Code integrated terminal.golang.org/x/tools/gopls v0.11.0
golang.org/x/tools/gopls@v0.11.0 h1:/nvKHdTtePQmrv9XN3gIUN9MOdUrKzO/dcqgbG6x8EY=
github.com/BurntSushi/toml@v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/google/go-cmp@v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/exp@v0.0.0-20221031165847-c99f073a8326 h1:QfTh0HpN6hlw6D3vu8DAwC8pBIwikq0AI1evdm+FksE=
golang.org/x/exp/typeparams@v0.0.0-20221031165847-c99f073a8326 h1:fl8k2zg28yA23264d82M4dp+YlJ3ngDcpuB1bewkQi4=
golang.org/x/mod@v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/sync@v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sys@v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/text@v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/tools@v0.3.1-0.20221213193459-ca17b2c27ca8 h1:7/HkGkN/2ktghBCSRRgp31wAww4syfsW52tj7yirjWk=
golang.org/x/vuln@v0.0.0-20221109205719-3af8368ee4fe h1:qptQiQwEpETwDiz85LKtChqif9xhVkAm8Nhxs0xnTww=
honnef.co/go/tools@v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=
mvdan.cc/gofumpt@v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
mvdan.cc/xurls/v2@v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.20.2
Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Check your installed extensions to get the version of the VS Code Go extension
Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.gopath: /Users/kylereis/go
GOROOT: /usr/local/Cellar/go/1.20.2/libexec
PATH: /usr/local/opt/dirmngr/bin:/usr/local/sbin:/usr/local/bin:/Users/kylereis/go/bin:/usr/local/Cellar/go/1.20.2/libexec/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/share/dotnet:~/.dotnet/tools:/usr/local/git/bin:/usr/local/MacGPG2/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin:/Applications/Wireshark.app/Contents/MacOS
go: /usr/local/bin/go: go version go1.20.2 darwin/amd64
gotests: /Users/kylereis/go/bin/gotests (version: v1.6.0 built with go: go1.20.2)
gomodifytags: /Users/kylereis/go/bin/gomodifytags (version: v1.16.0 built with go: go1.20.2)
impl: /Users/kylereis/go/bin/impl (version: v1.1.0 built with go: go1.20.2)
goplay: /Users/kylereis/go/bin/goplay (version: v1.0.0 built with go: go1.20.2)
dlv: /Users/kylereis/go/bin/dlv (version: unknown - )
staticcheck: /Users/kylereis/go/bin/staticcheck (version: v0.4.3 built with go: go1.20.2)
gopls: /Users/kylereis/go/bin/gopls (version: v0.11.0 built with go: go1.20.2)
go env
Workspace Folder (website): /Users/kylereis/Developer/website
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/kylereis/Library/Caches/go-build"
GOENV="/Users/kylereis/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/kylereis/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/kylereis/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.20.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.20.2/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.20.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="cc"
CXX="c++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/3v/20mqq59j7kg8nb5tc9jfltmc0000gp/T/go-build941490207=/tmp/go-build -gno-record-gcc-switches -fno-common"
Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
When VS Code is launched with a set but empty env var, it as unset when doing things like running tests and running the debugger. There was an issue open in the Vscode repo (microsoft/vscode#174330) but it has been closed as fixed, but I still have the issue. so I'm rporting here in case there is an issue in the extension too.
The environment variables should be treated as empty when running tests and the debugger.
Steps to reproduce the behavior:
ex.go
with the following contentex_test.go
with the following contentFOO="" BAR="test" code-insiders
ex_test.go
and run the testThe text was updated successfully, but these errors were encountered: