protocolbuffers / protobuf

Protocol Buffers - Google's data interchange format
http://protobuf.dev
Other
65.88k stars 15.52k forks source link

Singular Message Fields: invalid documentation #16346

Open 3052 opened 8 months ago

3052 commented 8 months ago

here:

https://protobuf.dev/reference/go/go-generated/#singular-message

it says:

The compiler also generates a func (m Concert) GetHeadliner() Band helper function. This function returns a nil *Band if m is nil or headliner is unset. This makes it possible to chain get calls without intermediate nil checks:

this is not correct. if the method actually returned nil, chaining would generate a panic. instead, it likely generates a zero value pointer:

new(Band)
&Band{}

that is not the same thing as nil

github-actions[bot] commented 5 months ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] commented 2 months ago

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.

3052 commented 2 months ago

!