Joe Tsai | 025d81d | 2018-08-03 15:53:13 -0700 | [diff] [blame] | 1 | // 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. |
| 6 | package flags |
| 7 | |
Joe Tsai | 1799d11 | 2019-08-08 13:31:59 -0700 | [diff] [blame] | 8 | // 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 Tsai | 025d81d | 2018-08-03 15:53:13 -0700 | [diff] [blame] | 12 | // |
Joe Tsai | 1799d11 | 2019-08-08 13:31:59 -0700 | [diff] [blame] | 13 | // This is disabled by default unless built with the "protolegacy" tag. |
Joe Tsai | 025d81d | 2018-08-03 15:53:13 -0700 | [diff] [blame] | 14 | // |
| 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 Tsai | 1799d11 | 2019-08-08 13:31:59 -0700 | [diff] [blame] | 17 | const ProtoLegacy = protoLegacy |
Damien Neil | 0ae1c97 | 2020-01-28 14:53:44 -0800 | [diff] [blame] | 18 | |
| 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. |
| 24 | const LazyUnmarshalExtensions = ProtoLegacy |