commit | eeca8bb946adf3da3b20fc65f998c7af4772330c | [log] [tgz] |
---|---|---|
author | Joe Tsai <joetsai@digital-static.net> | Tue Dec 04 16:24:22 2018 -0800 |
committer | Joe Tsai <thebrokentoaster@gmail.com> | Wed Dec 05 19:14:18 2018 +0000 |
tree | 02ba1e26b15cb1cd508c86940282f410531023fa | |
parent | e1f8d50e174b2a7bc8e7722353037f1387810f08 [diff] |
internal/legacy: drop dependency on protoV1 via vendoring In order to transition more of v1 proto package to use the v2 API, we need the v2 API to stop depending on v1 proto. The legacy package currently depends on v1 proto because it needs to unmarshal the descriptor protos. Ideally, we would switch this to use the v2 implementation of wire unmarshaling. However, that is not available yet. So, instead, we vendor a minified version of the v1 proto package that only supports unmarshaling. The only changes to the vendored v1 code are: * Delete code not needed to implement proto.Unmarshal * Drop support for message sets * Drop support for reporting the full field name for required not set errors The unused tool was used to delete unrelated code: https://github.com/dominikh/go-tools/tree/master/cmd/unused To verify that the dependency was dropped: $ cd internal/legacy $ go list -f "{{join .Deps \"\n\"}}" | sort | uniq | grep protobuf github.com/golang/protobuf/protoapi github.com/golang/protobuf/v2/internal/detrand github.com/golang/protobuf/v2/internal/encoding/tag github.com/golang/protobuf/v2/internal/encoding/text github.com/golang/protobuf/v2/internal/encoding/wire github.com/golang/protobuf/v2/internal/errors github.com/golang/protobuf/v2/internal/flags github.com/golang/protobuf/v2/internal/impl github.com/golang/protobuf/v2/internal/legacy/protoV1 github.com/golang/protobuf/v2/internal/pragma github.com/golang/protobuf/v2/internal/scalar github.com/golang/protobuf/v2/internal/set github.com/golang/protobuf/v2/internal/value github.com/golang/protobuf/v2/reflect/protoreflect github.com/golang/protobuf/v2/reflect/prototype github.com/golang/protobuf/v2/runtime/protoimpl github.com/golang/protobuf/v2/types/descriptor Change-Id: I470865f1a987203574339fefc7d83843a12af966 Reviewed-on: https://go-review.googlesource.com/c/152545 Reviewed-by: Damien Neil <dneil@google.com>
WARNING: This repository is in active development. There are no guarantees about API stability. Breaking changes will occur until a stable release is made and announced.
This repository is for the development of the next major Go implementation of protocol buffers. This library makes breaking API changes relative to the existing Go protobuf library. Of particular note, this API aims to make protobuf reflection a first-class feature of the API and implements the protobuf ecosystem in terms of reflection.
List of relevant design documents:
We appreciate community contributions. See CONTRIBUTING.md.
Issues regarding the new API can be filed at github.com/golang/protobuf. Please use a APIv2:
prefix in the title to make it clear that the issue is regarding the new API work.