You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 rivejä
1.4 KiB

  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 text implements the text format for protocol buffers.
  5. // This package has no semantic understanding for protocol buffers and is only
  6. // a parser and composer for the format.
  7. //
  8. // There is no formal specification for the protobuf text format, as such the
  9. // C++ implementation (see google::protobuf::TextFormat) is the reference
  10. // implementation of the text format.
  11. //
  12. // This package is neither a superset nor a subset of the C++ implementation.
  13. // This implementation permits a more liberal grammar in some cases to be
  14. // backwards compatible with the historical Go implementation.
  15. // Future parsings unique to Go should not be added.
  16. // Some grammars allowed by the C++ implementation are deliberately
  17. // not implemented here because they are considered a bug by the protobuf team
  18. // and should not be replicated.
  19. //
  20. // The Go implementation should implement a sufficient amount of the C++
  21. // grammar such that the default text serialization by C++ can be parsed by Go.
  22. // However, just because the C++ parser accepts some input does not mean that
  23. // the Go implementation should as well.
  24. //
  25. // The text format is almost a superset of JSON except:
  26. // - message keys are not quoted strings, but identifiers
  27. // - the top-level value must be a message without the delimiters
  28. package text