flags.go 1.1 KB

123456789101112131415161718192021222324
  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. // Package flags provides a set of flags controlled by build tags.
  5. package flags
  6. // ProtoLegacy specifies whether to enable support for legacy functionality
  7. // such as MessageSets, weak fields, and various other obscure behavior
  8. // that is necessary to maintain backwards compatibility with proto1 or
  9. // the pre-release variants of proto2 and proto3.
  10. //
  11. // This is disabled by default unless built with the "protolegacy" tag.
  12. //
  13. // WARNING: The compatibility agreement covers nothing provided by this flag.
  14. // As such, functionality may suddenly be removed or changed at our discretion.
  15. const ProtoLegacy = protoLegacy
  16. // LazyUnmarshalExtensions specifies whether to lazily unmarshal extensions.
  17. //
  18. // Lazy extension unmarshaling validates the contents of message-valued
  19. // extension fields at unmarshal time, but defers creating the message
  20. // structure until the extension is first accessed.
  21. const LazyUnmarshalExtensions = ProtoLegacy