canadadry
canadadry

Reputation: 8443

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

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 ?

Upvotes: 6

Views: 10479

Answers (1)

VonC
VonC

Reputation: 1323553

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.

Upvotes: 4

Related Questions