E6007 Import Errors

internal-import-denied

cannot import from internal/ directory outside package

When this occurs

Attempting to import internal module from outside its parent package

Example error message

error[E6007]: cannot import internal module 'pkg/internal/util' from outside 'pkg'

How to fix

Files in `internal/` directories can only be imported by files in the same package.

Related errors