Visual Studio Code using ?wrong? PATH, not finding GOPATH

I have go installed.
$ which go
/usr/bin/go
Installed Visual Studio Code (VSC) bundle, 1.40.1
Launch Visual Studio Code from options or install launch.
VSC emits this message at bottom right of its UI:
Failed to run “go env” to find GOPATH as the “go” binary cannot be found in either GOROOT(/usr/lib/golang) or PATH(/app/bin:/usr/bin:/home/mark/.var/app/com.visualstudio.code/data/node_modules/bin)

It does not looke like it is using my PATH. The reported error path does not match my environment PATH. A terminal session:
go env | grep GOPATH GOPATH="/home/mark/gocode" echo $PATH
/usr/local/bin:/usr/bin/haswell:/usr/bin:/opt/3rd-party/bin:/home/mark/bin:/home/mark/gocode/bin:/home/mark/flutter/bin:/usr/share/code/bin

A tar file of VSC 1.40, unpacked into a directory and executed from /home/mark/bin/VSCode-linux-x64.1.40.0/bin as ./code does not have this problem.

The flatpak VSCode cannot recognize external PATH.

Is there a workaround for this? Perhaps a way to inject PATH? Place a link to Go in the PATH list emitted by VSCode on the display?

I understand that, and I am running the tarball. Does this mean the flatpak version is useless to me? I think I recall there are redistribution or update issues with the not-flatpak version?

Will there be a notice on the community at some point if we resolve this issue?

Thank you.

Flatpak programs are sandboxed and this is a problem of flatpak instead of this distribution. I don’t know what is the problem with the tarball VSCode. As long as you don’t feel it, there’s no problem.