internal package
A package inside a folder called internal, which Go allows only code within the same parent folder tree to import.
In more detail
Put code under internal/ when you want other packages in your module to use it but outside modules to be unable to depend on it. Importing it from another module is a build error. It lets you change that code freely without breaking anyone.
Example
course.local/probe/internal/checkRelated terms
- Go package — A folder of Go source files that are compiled together and share one package name, which other code imports as a unit.
- exported identifier — A name in Go that starts with a capital letter, which makes it visible to code in other packages.
- import path — The string that identifies a package in an import line: the module path followed by the folder inside the module.
Taught in
- Go Workspaces and Modules — Concurrent Systems Programming with Go