Closed thevillem closed 5 years ago
Is the /go
directory mentioned here a module? It looks like not, but I'm not sure based only on the log output you quoted.
Note that the go get
command treats imports differently depending on whether your current working directory is (or is not) inside a module, and whether it's inside $GOPATH
. Based on the error message, I think you are probably inside $GOPATH
for your system (possibly a container image?) but probably not a module (no go.mod
file?)
Please try this, and see if it works:
$ mkdir /tmp/importest ; cd /tmp/importest
$ go mod init importest
$ go get github.com/src-d/enry/v2
If that does work, then it probably means your /go
directory is not set up as a module (which would be consistent with a container $GOPATH
). Can you say a bit more specifically what you're trying to do?
Thanks for your quick reply, I made a beginner mistake here and didn't run the go mod init
command before running the go get
.
After running the init I am able to fetch enry.
Great, thanks for the update. In that case, I'm going to go ahead and close this issue, but if you have more related troubles please feel free to reopen it.
I am trying to install enry for use within my golang script, when grabbing the package I get the following error.
Here is the output of my
go version
I followed the instructions in #239 , but I am unsure of what I am still doing wrong.
Any guidance would be greatly appreciated.