Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proto3's optional keyword causes issues in zap code generation #5

Open
stewartboyd119 opened this issue Dec 1, 2021 · 0 comments
Open

Comments

@stewartboyd119
Copy link

Proto3 introduced version 3.12 changelog introduced the optional field label.

However, a message like this:

message Sender { optional string polaris_id = 1; }

generated code like this

`
keyName = "polaris_id" // field polaris_id = 1
if ov, ok := m.GetXPolarisId().(*Sender_PolarisId); ok {
_ = ov
enc.AddString(keyName, ov.PolarisId)
}

`

However, the GetXPolarisId() doesn't exist and creates a compiletime error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant