HiveBrain v1.2.0
Get Started
← Back to all entries
debuggoModerate

Getting GOPATH error "go: cannot use path@version syntax in GOPATH mode" in Ubuntu 16.04

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
errormodegettingsyntaxusepathubuntucannotgopathversion

Problem

I'm unable to run go get git@github in my $GOPATH folder.
Getting this error:


go: cannot use path@version syntax in GOPATH mode

I just want to understand why go get isn't working even though $GOPATH is configured during the installation. Environment is ubuntu.

~/$ echo $GOPATH
/home/user/go

Solution

As you already noticed, you should use go get github.com//.

The error message you saw comes from a new feature implemented in go get to support Go modules - you can now also specify the version of a dependency: go get github.com//@, where version is a git tag using semver, e.g. v1.0.2.

Context

Stack Overflow Q#54415733, score: 37

Revisions (0)

No revisions yet.