Home > Software engineering >  golang.org/x/tools/gopls gives not a valid zip file
golang.org/x/tools/gopls gives not a valid zip file

Time:11-18

I'm using golang version go1.17.3 linux/amd64 and when I try to install golang.org/x/tools/gopls using this command (as per the docs):

GO111MODULE=on go get golang.org/x/tools/gopls@latest

I get this error:

verifying golang.org/x/tools/gopls@v0.7.3: zip: not a valid zip file

Any help with this error?

CodePudding user response:

I found the solution. It seems the problem happens when you copy your mod folder from an older installation. The solution is:

go clean -modcache

This will clear your mod cache and allow installation to work again.

  •  Tags:  
  • go
  • Related