An non-obvious use case for aliases

Aliases can be used to export Go types declared under an "internal" package which restricts their visibility. For example, given the type "type A struct {}" declared in the "/internal/hidden" package, an alias declared as "type ExportedA = hidden.A" in the "/pkg" package would render "A" exported but under the "/pkg" package.

Comments