blob: ab62da2df06da2c29bf0f6d45503957aac621f7a [file] [log] [blame]
Joe Tsai025d81d2018-08-03 15:53:13 -07001// Copyright 2018 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Package flags provides a set of flags controlled by build tags.
6package flags
7
Joe Tsai1799d112019-08-08 13:31:59 -07008// ProtoLegacy specifies whether to enable support for legacy functionality
9// such as MessageSets, weak fields, and various other obscure behavior
10// that is necessary to maintain backwards compatibility with proto1 or
11// the pre-release variants of proto2 and proto3.
Joe Tsai025d81d2018-08-03 15:53:13 -070012//
Joe Tsai1799d112019-08-08 13:31:59 -070013// This is disabled by default unless built with the "protolegacy" tag.
Joe Tsai025d81d2018-08-03 15:53:13 -070014//
15// WARNING: The compatibility agreement covers nothing provided by this flag.
16// As such, functionality may suddenly be removed or changed at our discretion.
Joe Tsai1799d112019-08-08 13:31:59 -070017const ProtoLegacy = protoLegacy
Damien Neil0ae1c972020-01-28 14:53:44 -080018
19// LazyUnmarshalExtension specifies whether to lazily unmarshal extensions.
20//
21// Lazy extension unmarshaling validates the contents of message-valued
22// extension fields at unmarshal time, but defers creating the message
23// structure until the extension is first accessed.
24const LazyUnmarshalExtensions = ProtoLegacy