protobuf-go/internal/impl
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
..
api_export.go internal/impl: move legacy files into impl 2019-05-22 19:40:32 +00:00
codec_extension.go internal/impl: unexport ExtensionField.Desc 2019-06-05 20:15:29 +00:00
codec_field.go internal/impl: rename encode_field.go->codec_field.go 2019-07-08 20:13:10 +00:00
codec_gen.go internal/impl: rename encode->codec in various places 2019-07-08 20:12:42 +00:00
codec_map_go111.go internal/impl: rename encode->codec in various places 2019-07-08 20:12:42 +00:00
codec_map_go112.go internal/impl: rename encode->codec in various places 2019-07-08 20:12:42 +00:00
codec_map.go internal/impl: rename encode->codec in various places 2019-07-08 20:12:42 +00:00
codec_message.go cmd/protoc-gen-go: unexport implementation-specific XXX fields 2019-07-08 20:45:09 +00:00
codec_reflect.go internal/impl: rename encode->codec in various places 2019-07-08 20:12:42 +00:00
codec_tables.go internal/impl: rename encode->codec in various places 2019-07-08 20:12:42 +00:00
codec_unsafe.go internal/impl: rename encode->codec in various places 2019-07-08 20:12:42 +00:00
encode.go internal/impl: refactor fast-path 2019-06-27 20:08:19 +00:00
isinit.go internal/impl: refactor fast-path 2019-06-27 20:08:19 +00:00
legacy_aberrant_test.go internal/impl: fix race in aberrant message logic 2019-07-02 18:39:06 +00:00
legacy_enum.go internal/impl: support aberrant enums and messages 2019-07-01 21:18:15 +00:00
legacy_export_test.go
legacy_export.go
legacy_extension.go internal/filedesc, internal/filetype: initial commit 2019-06-20 02:06:11 +00:00
legacy_file_test.go reflect/protoreflect: remove FieldDescriptor.{Oneof,Extendee} methods 2019-06-17 19:43:30 +00:00
legacy_file.go internal/filedesc, internal/filetype: initial commit 2019-06-20 02:06:11 +00:00
legacy_message.go all: fix stale comments 2019-07-08 18:33:38 +00:00
legacy_test.go all: remove protoreflect.Message.Len 2019-06-25 21:59:46 +00:00
message_field.go cmd/protoc-gen-go: unexport implementation-specific XXX fields 2019-07-08 20:45:09 +00:00
message_test.go encoding/prototext: fix parsing of field names 2019-06-25 21:57:50 +00:00
message.go cmd/protoc-gen-go: unexport implementation-specific XXX fields 2019-07-08 20:45:09 +00:00
pointer_reflect.go cmd/protoc-gen-go: unexport implementation-specific XXX fields 2019-07-08 20:45:09 +00:00
pointer_unsafe.go cmd/protoc-gen-go: unexport implementation-specific XXX fields 2019-07-08 20:45:09 +00:00