3 ms·
Technically, exported/unexported is different than public/private since its at the package level. You can access unexported fields of a struct from anywhere wit
by gtremper 10y ago
Technically, exported/unexported is different than public/private since its at the package level. You can access unexported fields of a struct from anywhere within the same package (not just from that struct's "methods"), which isn't true of a 'private' field.
- krylon 10y agoIIRC, that is also true for protected members in Java (it has been a while, though, since I have written anything in Java). If that is a concern, you can create a new package for your type.