Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

golang.org/x/tools/gopls gives not a valid zip file

Tags:

go

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/[email protected]: zip: not a valid zip file

Any help with this error?

like image 602
Roshan Rush Avatar asked Dec 10 '25 04:12

Roshan Rush


1 Answers

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.

like image 76
Roshan Rush Avatar answered Dec 11 '25 23:12

Roshan Rush