protobuf-go/internal/genname/name.go
Joe Tsai 4663ebc852 internal/genname: centralize the definitions for generated names
Both the generator and the runtime need to agree upon the names of
specialized Go struct fields. Centralize that information in an
internal genname package.

In the mean time, also change the XXX_weak field name to match
the name used internally at Google.

Change-Id: I026bf354418c363482e5902f21aa5e0cacae24b0
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/207080
Reviewed-by: Damien Neil <dneil@google.com>
2019-12-09 22:57:38 +00:00

26 lines
600 B
Go

// 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.
// Package genname contains constants for generated names.
package genname
const (
State = "state"
SizeCache = "sizeCache"
SizeCacheA = "XXX_sizecache"
WeakFields = "weakFields"
WeakFieldsA = "XXX_weak"
UnknownFields = "unknownFields"
UnknownFieldsA = "XXX_unrecognized"
ExtensionFields = "extensionFields"
ExtensionFieldsA = "XXX_InternalExtensions"
ExtensionFieldsB = "XXX_extensions"
WeakFieldPrefix = "XXX_weak_"
)