"import loop not allowed" when executing test in golang example
I'm trying to set up tests for my functions in golang, but I get the following error when running go test ...
from the console:
Import cycle not allowed. imports unsafe runtime imports
Thinking it was me, I cloned the golang example project and ran go test reverse_test.go
but was getting the same error. Both are environment GOPATH
and are GOROOT
set to C:\go
where I installed Go. I am working on Windows 8.1, 64 bit machine.
Any ideas what's wrong?
source to share
Be sure to do " go get github.com/golang/example/hello
" (as pointed out at github.com/golang/example ) once your GOPATH is set to the correct path.
See " How to Write a Transition Code :
The environment variable
GOPATH
indicates the location of your workspace. This is most likely the only environment variable you need to set when developing your Go code.
You should see yours github/golang/example
inside$GOPATH/src
source to share