Issue
I’m trying to install golint with the command: go get -u golang.org/x/lint/golint.
And I think I got two problems:
go get: warning:
modules disabled by GO111MODULE=auto in GOPATH/src;
ignoring ../go.mod;
see 'go help modules'
package golang.org/x/lint/golint:
unrecognized import path "golang.org/x/lint/golint" (https fetch: Get https://golang.org/x/lint/golint?go-get=1: dial tcp 216.58.200.192:443: i/o timeout)
I then try to install golang/tools, also failed…
package golang.org/x/tools: unrecognized import path "golang.org/x/tools" (https fetch: Get https://golang.org/x/tools?go-get=1: dial tcp 216.58.200.192:443: i/o timeout)
Solution
It looks like you have a go.mod
file inside $GOPATH/ (under $GOPATH/go.mod
). You should remove that. Also, since you are using Go 1.11 or newer, you can run the go get
command from well outside of GOPATH/any directory containing a go.mod
file either directly or in a parent directory, and then the command should work.
Answered By – dlsniper
Answer Checked By – Mildred Charles (GoLangFix Admin)