go build command fails with "$GOPATH/go.mod exists but should not"

Created on 6 May 2020  路  1Comment  路  Source: golang/go

What version of Go are you using (go version)?

$ go version

go version go1.13.3 linux/amd64

Does this issue reproduce with the latest release?

NA

What operating system and processor architecture are you using (go env)?

go env Output

$ go env

$GOPATH/go.mod exists but should not

What did you do?

What did you expect to see?

nothing is working go build or go env all fail with this
$GOPATH/go.mod exists but should not

What did you see instead?

$GOPATH/go.mod exists but should not

Most helpful comment

I had set the wrong GOPATH

we should set GOPATH in such a way that when we go inside the GOPATH we should able to see src directory

>All comments

I had set the wrong GOPATH

we should set GOPATH in such a way that when we go inside the GOPATH we should able to see src directory

Was this page helpful?
0 / 5 - 0 ratings