Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix the error message "use of an internal package not allowed" when go getting a golang package?

Tags:

go

I am using go 1.5.3. I ran this

go get -x github.com/goji/goji

and I am getting this error message:

git checkout master
package github.com/goji/goji
imports goji.io/internal: use of internal package not allowed

How do I resolve this ?

like image 545
canadadry Avatar asked Sep 25 '22 14:09

canadadry


1 Answers

From that goji issue 13, the right command is:

go get goji.io

That page http://goji.io/ has the go-import meta directive:

<meta name="go-import" content="goji.io git https://github.com/goji/goji">

That way, go does not consider goji.io/internal (see for instance router.go) as trying to import internal package of a "third-party".
This issue illustrates the wrong internal import case:

You are not allowed to import internal package (or its subpackages) of a third party repo.

like image 64
VonC Avatar answered Sep 28 '22 06:09

VonC