3 ms·
I haven't looked in more detail, but one blocker is that `ProtoMethods() *methods` returns a private type, making it effectively unimplementable outside this pa
by alecthomas 5y ago
I haven't looked in more detail, but one blocker is that `ProtoMethods() *methods` returns a private type, making it effectively unimplementable outside this package.
- zeeboo 5y agoSo, I thought this at one point, too. But it turns out that methods is a type alias to an unnamed type, so there's no package level privacy issues: https://github.com/protocolbuffers/protobuf-go/blob/v1.26.0/reflect/protoreflect/methods.go#L18 https://github.com/protocolbuffers/protobuf-go/blob/v1.26.0/...
- deleted 5y ago[deleted]
- alecthomas 5y agoOh huh, interesting, I've never seen that done before. I'm struggling to understand what the rationale _for_ doing it is though. Maybe it's to avoid an import cycle?
- neild 5y agoYes, to avoid an import cycle or polluting the protoreflect API documentation with a rather large non-user-facing API surface.