mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2024-12-28 00:19:55 +00:00
b0c26f1868
This adds a experimental function to the internal/impl package which validates a wire-format message against a message type. The validator reports whether the message can be successfully unmarshaled, and whether the result is initialized (all required fields are set). In some cases, the validator returns ambiguous results when full validation would be expensive. The validator is unused outside of tests. In the future, it may be used to permit lazy unmarshaling of some data. It is being added now for testing; in particular, the wire fuzzer now checks the validator output for consistency with the unmarshaler. The validator adds a small amount of unused per-MessageType state. If this becomes a concern, we could conditionalize it with a build tag. Change-Id: I4216ef81d6a9ed975302eed189b02d08608858b4 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/212302 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> |
||
---|---|---|
.. | ||
bench_test.go | ||
decode_gen.go | ||
decode_test.go | ||
decode.go | ||
doc.go | ||
encode_gen.go | ||
encode_test.go | ||
encode.go | ||
equal_test.go | ||
equal.go | ||
extension_test.go | ||
extension.go | ||
isinit_test.go | ||
isinit.go | ||
merge_test.go | ||
merge.go | ||
messageset_test.go | ||
messageset.go | ||
methods_test.go | ||
noenforceutf8_test.go | ||
proto_methods.go | ||
proto_reflect.go | ||
proto.go | ||
reset_test.go | ||
reset.go | ||
size_gen.go | ||
size.go | ||
testmessages_test.go | ||
validate_test.go | ||
weak_test.go | ||
wrappers.go |