mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-06 00:55:51 +00:00
26aef9d6d6
Field-tracking is an experimental feature in the Go linker where it statically tracks whether a Go struct field is used. This CL modifies the generator to emit special markers that tells the linker to know which fields to track. Change-Id: I235da3f3d6c0ef2021b5fe1c16106ebb8fd6f557 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/189558 Reviewed-by: Damien Neil <dneil@google.com>
20 lines
674 B
Protocol Buffer
20 lines
674 B
Protocol Buffer
// Copyright 2019 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
syntax = "proto2";
|
|
|
|
package go_annotation;
|
|
|
|
import "google/protobuf/descriptor.proto";
|
|
|
|
option go_package = "google.golang.org/protobuf/internal/testprotos/annotation";
|
|
|
|
extend google.protobuf.MessageOptions {
|
|
// Setting this on a message enables tracking of which fields in the message
|
|
// a specific binary might access. As a consequence, it also disables the use
|
|
// of the message accessor methods to satisfy interfaces: they can only be
|
|
// called directly.
|
|
optional bool track_field_use = 37383685;
|
|
}
|