protobuf-go/reflect/protoreflect
Joe Tsai e14d6b3cdc reflect/protoreflect: add FieldDescriptor.TextName
Add a new TextName accessor that returns the field name that should
be used for the text format. It is usually just the field name, except:
1) it uses the inlined message name for groups,
2) uses the full name surrounded by brackets for extensions, and
3) strips the "message_set_extension" for well-formed extensions
to the proto1 MessageSet.

We make similar adjustments to the JSONName accessor so that it applies
similar semantics for extensions.

The two changes simplifies all logic that wants the humanly readable
name for a field.

Change-Id: I524b6e017fb955146db81819270fe197f8f97980
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/239838
Reviewed-by: Herbie Ong <herbie@google.com>
2020-07-08 23:23:57 +00:00
..
methods.go all: rename IsInitialized as CheckInitialized 2020-02-20 20:45:40 +00:00
proto_test.go reflect/protoreflect: optimize Name.IsValid and FullName.IsValid 2020-06-16 19:13:20 +00:00
proto.go reflect/protoreflect: optimize Name.IsValid and FullName.IsValid 2020-06-16 19:13:20 +00:00
source.go reflect/protoreflect: update documentation 2020-02-15 00:23:47 +00:00
type.go reflect/protoreflect: add FieldDescriptor.TextName 2020-07-08 23:23:57 +00:00
value_pure.go
value_test.go
value_union.go reflect/protoreflect: adjust ValueOf panic message 2020-05-26 22:22:26 +00:00
value_unsafe.go
value.go reflect/protoreflect: cleanup wording on Message.NewField 2020-04-21 00:34:41 +00:00