Backstory
I got this error amongst numerous others setting up a new virtual box LMDE5 on my new windows 11 pro computer. I haven't used windows in about 12 years, and the changes were crazy causing countless errors on Windows and LMDE5 Vbox. My last issue was this in vs code.
Error
go module packages.Load error: err: exit status 2: stderr: go: no such tool "compile": go list
My project directory structure
.
├── docker-compose.yaml
├── project.code-workspace
├── go.mod
├── go.sum
├── main.go
└── sub_packages
├── backend
│ ├── folder1
│ ├── folder2
├── api
│ ├── handlers
│ └── requests
├── entities
├── services
└── utils
settings.json file
{
// ...
"go.goroot": "/usr/local/go",
"go.gopath": "/home/user_name/go",
// ...
}