protobuf-go/internal/filedesc
Joe Tsai 8a4c3d18b1 internal/filedesc: avoid deep-copying the options
The protoreflect.Descriptor.Options method is currently documented as
returning a reference to the options, where the user must not mutate
the returned message. This changes internal/filedesc to avoid returning
a copy of the options by caching the first unmarshal.

See golang/protobuf#877

Change-Id: I15701d33fbda7535b21b2add72628b02992c373f
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/185197
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
2019-07-08 17:26:50 +00:00
..
build_test.go all: remove dependency on proto v1 2019-07-03 04:59:17 +00:00
build.go reflect/protoregistry: remove Files.Find{Enum,Message,Extension,Service}ByName 2019-06-24 23:47:12 +00:00
desc_init.go reflect/protoreflect: register all desciptors in Files 2019-06-24 22:35:47 +00:00
desc_lazy.go internal/filedesc: avoid deep-copying the options 2019-07-08 17:26:50 +00:00
desc_list_gen.go internal/filedesc, internal/filetype: initial commit 2019-06-20 02:06:11 +00:00
desc_list.go reflect/protodesc: enforce strict validation 2019-07-03 20:46:51 +00:00
desc_test.go reflect/protodesc: enforce strict validation 2019-07-03 20:46:51 +00:00
desc.go internal/impl: support aberrant enums and messages 2019-07-01 21:18:15 +00:00
name_pure.go internal/filedesc, internal/filetype: initial commit 2019-06-20 02:06:11 +00:00
name_unsafe.go internal/filedesc, internal/filetype: initial commit 2019-06-20 02:06:11 +00:00
placeholder.go internal/impl: support aberrant enums and messages 2019-07-01 21:18:15 +00:00