I recently started to work on a Go project.
When I use gopls with Coc, all external imports are not recognized such as "github.com/prometheus/client_golang/prometheus". It complains it could not find this module from neither $GOROOT and $GOPATH.
This project is managed by bazel, and all depedencies are listed in WORKSPACE file. Do I have any way to install all packages based on WORKSPACE file or I have to go install all packages one by one? If the latter, I would imagine keep package version synced is challenaging.
I've recently faced the same issue. For me, the problem was in
GOPATHenv variable. Make sure that you are exporting the variable in~/.profilefor example.The correct path for Go you can query like that:
go env GOPATH