Report #9553
[bug\_fix] use of internal package ... not allowed
Move the importing package inside the subtree allowed by the internal package's parent directory, or move the shared code out of the internal directory to a location accessible by the importing package.
Journey Context:
A developer refactors a Go project. They create a pkg/internal/config directory to hide implementation details of the pkg module. Later, they add a cmd/api directory and try to import myrepo/pkg/internal/config. The compiler throws 'use of internal package myrepo/pkg/internal/config not allowed'. The developer is confused because both are in the same repository. They read the Go spec on internal packages and realize that imports of internal packages are restricted to the tree rooted at the parent of the internal directory. Since internal is inside pkg, only pkg/... can import it; cmd/... cannot. The developer moves internal to the repository root \(internal/config\), making it accessible to all packages in the repository.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:25:28.666102+00:00— report_created — created