xref: /aosp_15_r20/external/golang-protobuf/internal/flags/flags.go (revision 1c12ee1efe575feb122dbf939ff15148a3b3e8f2)
1*1c12ee1eSDan Willemsen// Copyright 2018 The Go Authors. All rights reserved.
2*1c12ee1eSDan Willemsen// Use of this source code is governed by a BSD-style
3*1c12ee1eSDan Willemsen// license that can be found in the LICENSE file.
4*1c12ee1eSDan Willemsen
5*1c12ee1eSDan Willemsen// Package flags provides a set of flags controlled by build tags.
6*1c12ee1eSDan Willemsenpackage flags
7*1c12ee1eSDan Willemsen
8*1c12ee1eSDan Willemsen// ProtoLegacy specifies whether to enable support for legacy functionality
9*1c12ee1eSDan Willemsen// such as MessageSets, weak fields, and various other obscure behavior
10*1c12ee1eSDan Willemsen// that is necessary to maintain backwards compatibility with proto1 or
11*1c12ee1eSDan Willemsen// the pre-release variants of proto2 and proto3.
12*1c12ee1eSDan Willemsen//
13*1c12ee1eSDan Willemsen// This is disabled by default unless built with the "protolegacy" tag.
14*1c12ee1eSDan Willemsen//
15*1c12ee1eSDan Willemsen// WARNING: The compatibility agreement covers nothing provided by this flag.
16*1c12ee1eSDan Willemsen// As such, functionality may suddenly be removed or changed at our discretion.
17*1c12ee1eSDan Willemsenconst ProtoLegacy = protoLegacy
18*1c12ee1eSDan Willemsen
19*1c12ee1eSDan Willemsen// LazyUnmarshalExtensions specifies whether to lazily unmarshal extensions.
20*1c12ee1eSDan Willemsen//
21*1c12ee1eSDan Willemsen// Lazy extension unmarshaling validates the contents of message-valued
22*1c12ee1eSDan Willemsen// extension fields at unmarshal time, but defers creating the message
23*1c12ee1eSDan Willemsen// structure until the extension is first accessed.
24*1c12ee1eSDan Willemsenconst LazyUnmarshalExtensions = ProtoLegacy
25