protocolbuffers / txtpbfmt

txtpbfmt parses, edits and formats text proto files in a way that preserves comments.
Apache License 2.0
99 stars 19 forks source link

Update `parser.ByFieldOrder` to make it clear that it is transitive and stable. #103

Closed copybara-service[bot] closed 1 year ago

copybara-service[bot] commented 1 year ago

Update parser.ByFieldOrder to make it clear that it is transitive and stable.

https://pkg.go.dev/sort#Interface says:

Less must describe a transitive ordering:

  • if both Less(i, j) and Less(j, k) are true, then Less(i, k) must be true as well.
  • if both Less(i, j) and Less(j, k) are false, then Less(i, k) must be false as well.