mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2024-12-29 12:17:48 +00:00
82a0306187
Weak fields are an obsolete proto1 feature. They have been superseded by extensions. However, some vestigial support for weak fields does remain, mostly as Google-internal patches. (They aren't exciting; extensions really do everything weak fields do in a cleaner and more portable fashion.) At the moment, the only visible impact of marking a field [weak=true] is to exclude it from "internal/fileinit".FileBuilder.DependencyIndexes. We want to preserve that behavior just in case we ever do add full weak field support here. Extend fileinit to look up message descriptors for weak fields in the global registry. If the descriptor cannot be found, use a placeholder instead. Remove special-case handling of weak fields in the impl package. The code generator doesn't do anything special for them, so they can be treated as any other field. Change-Id: Ifa2ee3d30d63680a0eeb59c66ebc9521f38fd660 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/175997 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> |
||
---|---|---|
.. | ||
prototest |