In addition to the provider folder, you can still have one GOPATH for each project.
GOPATH by go.inferGopath setting
Setting go.inferGopath overrides all of the above.
If go.inferGopath set to true , the extension will try to infer GOPATH from the workspace path, that is, the directory opened in vscode. It searches up the path for the src directory and sets GOPATH one level above this.
For example, if your project looks like /aaa/bbb/ccc/src/... , then opening the directory /aaa/bbb/ccc/src (or something below) will cause the extension to look up, find the component src on the way and set GOPATH one level up, i.e. GOPATH=/aaa/bbb/ccc .
This option is useful when you are working on different Go projects that have different GOPATH s. Instead of setting GOPATH in the workspace settings for each project or setting all paths as ;/: split lines, you can simply set go.inferGopath to true , and the extension automatically uses GOPATH .
GOPATH to install Go tools with go.toolsGopath
By default, all Go dependent tools are used from GOPATH derived from the above logic.
If available on your PATH , PATH used to search for Go tools.
If the Go tools are not in your way, you can get the same Go tools that are installed in each of your GOPATH s.
To prevent Go tools from cluttering up your GOPATH , use the go.toolsGopath parameter to provide a separate place for Go tools.
The first time you run go.toolsGopath, you will need to run the Go: Install Tools command so that the Go tools are installed in the provided location.