Home >Backend Development >Golang >Why is 'cannot use path@version syntax in GOPATH mode' appearing when I use `go get`, and how can I fix it?
The error message "cannot use path@version syntax in GOPATH mode" indicates that you're attempting to use the go get command with a syntax that's not supported when using the GOPATH mode.
In order to retrieve a package from a local server using go get, you should omit the path and version information. For instance, instead of using go get [email protected]:/srv/git/liqid.git, you should use go get github.com/username/repo-name or go get golang.org/x/repo-name.
Here are some additional details that might be helpful:
Remember to replace "username" and "repo-name" with the actual values for the GitHub user and repository name.
I recommend consulting the official Go documentation for more detailed information on using go get and working with packages in Go.
The above is the detailed content of Why is 'cannot use path@version syntax in GOPATH mode' appearing when I use `go get`, and how can I fix it?. For more information, please follow other related articles on the PHP Chinese website!