build error: use of internal package not allowed
I am using centos 7.5. Any idea how to fix this?
$ go version
go version go1.9.4 linux/amd64
$ make build
GOBIN=/home/admincentos/src/go/loadgen/bin go install -v \
./vendor/github.com/golang/lint/golint \
./vendor/github.com/kisielk/errcheck \
./vendor/golang.org/x/tools/cmd/goimports
import cycle not allowed
package ./vendor/github.com/golang/lint/golint
imports flag
imports errors
imports runtime
imports runtime/internal/atomic
imports unsafe
imports runtime
vendor/github.com/kisielk/errcheck/main.go:13:2: use of internal package not allowed
make: *** [deps] Error 1
I got the same error? @beheerderdag Did you managed to solve it?
No. I will try it again sometime soon. I think there is a different way to include the internal package in Go but haven't figured it out.
Thanks @beheerderdag! please share if you get some workaround/solution for it. I am also trying to overcome this issue.
@acloudiator I think I got it to work but I am not sure if this is the right way to do this. I haven't used go much. So first, yum install in centos will get you an older Go. I think this requires a newer version. Go get the latest one.
If I understood correctly the issue is go is trying to install the following packages but they are located in the same folder i.e. "internal" to the current package. So I created a folder in /root/go. Then pointed $GOPATH to that. And try to install the packages there.
deps:
GOBIN=$(abspath bin) $(GO) install -v \
./vendor/github.com/golang/lint/golint \
./vendor/github.com/kisielk/errcheck \
./vendor/golang.org/x/tools/cmd/goimports
Then install them manually via the go command and comment these above lines. Then run make build. Again, this was bit cumbersome so would like to figure out a better way to do this.