protobuf-go/internal
Joe Tsai c0e4bb2054 cmd/protoc-gen-go: unexport implementation-specific XXX fields
We modify protoc-gen-go to stop generating exported XXX fields.
The unsafe implementation is unaffected by this change since unsafe
can access fields regardless of visibility. However, for the purego
implementation, we need to respect Go visibility rules as enforced
by the reflect package.

We work around this by generating a exporter function that given
a reference to the message and the field to export, returns a reference
to the unexported field value. This exporter function is protected by
a constant such that it is not linked into the final binary in non-purego
build environment.

Updates golang/protobuf#276

Change-Id: Idf5c1f158973fa1c61187ff41440acb21c5dac94
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/185141
Reviewed-by: Damien Neil <dneil@google.com>
2019-07-08 20:45:09 +00:00
..
cmd internal/impl: rename encode->codec in various places 2019-07-08 20:12:42 +00:00
descfmt reflect/protoreflect: remove FieldDescriptor.{Oneof,Extendee} methods 2019-06-17 19:43:30 +00:00
descopts internal/filedesc, internal/filetype: initial commit 2019-06-20 02:06:11 +00:00
detrand
encoding internal/encoding/wire: fix trivial misspelling 2019-07-08 20:14:46 +00:00
errors all: remove non-fatal UTF-8 validation errors (and non-fatal in general) 2019-06-20 20:55:13 +00:00
fieldnum
filedesc internal/filedesc: avoid deep-copying the options 2019-07-08 17:26:50 +00:00
filetype reflect/protoregistry: remove Files.Find{Enum,Message,Extension,Service}ByName 2019-06-24 23:47:12 +00:00
flags
impl cmd/protoc-gen-go: unexport implementation-specific XXX fields 2019-07-08 20:45:09 +00:00
mapsort all: change module to google.golang.org/protobuf 2019-05-14 17:28:29 +00:00
pragma
scalar
set
testprotos cmd/protoc-gen-go: unexport implementation-specific XXX fields 2019-07-08 20:45:09 +00:00
value reflect/protoreflect: add alternative message reflection API 2019-06-17 17:33:24 +00:00