2 ms·
the purpose is to not be able to use the interface outside the module, right? why wouldn't you just use an interface type with a lowercase name, which wouldn't
by philsnow 13y ago
the purpose is to not be able to use the interface outside the module, right? why wouldn't you just use an interface type with a lowercase name, which wouldn't be visible outside the module?
- bslatkin 13y agoYou want to be able to use the interface outside the module, but not allow anyone else to implement that interface.
- Laremere 13y agoThe purpose was to not allow defining types which satisfy the interface outside the package. In this case they still want others to be able to use the values of the interface. It's an uncommon thing to need to do, but this example shows that you can do it.