Yesterday I helped a colleague install go on his Windows 10 PC. We downloaded and installed the latest (v1.12.5) from golang.org. No errors were reported during the install. We ran into problems trying to get and build a private project we're collaborating on.
The first problem was trying to use go get to fetch the project into the go/src tree. It prompted for his GitHub password and appeared to be downloading but failed with a complaint that the project contained no Go files. So we git cloned the project directly under C:\go\src. That succeeded, but attempting to build produces complaints about "use of internal package not allowed".
There are multiple prior reports of this error message on SO (e.g. golang disable "use of internal package not allowed") and as issues in golang/go (e.g. https://github.com/golang/go/issues/26446) but most of the discussions explain the problem as having to do with attempts to import from internals of packages with repositories outside the project root. That's not the case here.
The project is pure Go and all of the code in the repo builds successfully on OS-X and Linux.
For the above reasons, I believe this question is not a duplicate.
For reference, here is a much reduced view of the project directory installed under the go/src tree showing one of the files that produces the error when attempting to run go build. In this case the complaint references the internal/ace/ package as the disallowed import but the problem also occurs in other subdirectories (not shown) that import from other internal packages (also not shown.)
go
└── src
├── github.com
│ ├── Michael-F-Ellis
│ │ ├── pgcgo
│ │ │ ├── internal
│ │ │ │ ├── ace
│ │ │ ├── setacertc
│ │ │ ├ ├── main.go
Here is the outline of setacertc/main.go:
// setacertc is intended to be run from an internet-connected host to
// set the real-time-clock on the ACE11.
package main
import (
"fmt"
"log"
"math/rand"
"time"
"github.com/Michael-F-Ellis/pgcgo/internal/ace"
)
func main() {
// SNIP
}
I suspect the problem is somehow specific to a new installation and/or running Go under Windows. Any help appreciated.