3 ms·
Packages have to be used for access control as long as there’s no other way to do it. You’re committing to support uses of anything you make public.
by erik_seaberg 7y ago
Packages have to be used for access control as long as there’s no other way to do it. You’re committing to support uses of anything you make public.
- sagichmal 7y agoWhat? Exporting a type or field is an opt-in decision, you don't need a special package per type to do it. If the fear is that other types or functions in the same package can access the unexported fields, that's unavoidable, making a new package per type doesn't reduce the risk.