I use a custom location for GOMODCACHE (~/.gomodcache/) and GOPATH ~/project/go
. This is to handle the errors from GOPLS while using the mono-repo approach of workspace.
When I do go get
, the modules are downloaded to GOMODCACHE but, unable to see them in GOPATH. I use VSCode’s Go plugin. The plugin just looks for the list of modules from GOPATH and GOROOT. So, the plugin is unable to find the modules from GOMODCACHE and unable to provide suggestions on autocomplete.
Is there a way to get the modules into GOPATH instead of GOMODCACHE? Or Is there a way to make vscode to read the modules from GOMODCACHE instead of GOPATH?