protogetter
protogetter copied to clipboard
Disallow Get on fields that are a part of a `oneof`
Is it possible to instruct the linter to error on cases where you're getting one of the fields inside of a oneof?
For example:
message Foo {
oneof bar {
string baz = 1;
string quix = 2;
}
}
I would like to make it a lint error to call GetBaz and GetQuix directly in favor of always doing a type switch on the output of GetBar(). I don't see a documented way to do that but was curious if such a thing was possible.
Thanks so much!
Thank you for your interest in the project.
I think we can make an optional setting for this case. I'll see what I can do as soon as I can.
Thanks for the idea!