Re:Things Go needs more than generics
by mbnull on Monday October 04, 2021 @07:22AM
(#28745322)
unless errorlevel is exported as ErrorLevel you can only do so inside the declaring package.
[ Parent
| on HN ]
Indeed, that was the idea behind keeping it unexported.
From an external package you can only access the explicit values and the functions that accept them as parameters. The type is opaque for the developer.
Re:Things Go needs more than generics
by marcus_holmes on Monday October 04, 2021 @09:14AM
(#28746264)
Yeah, ok, fair point. That kinda works, but enums would be better