Overview
This release provides specialized support for well-known types.
Notable changes
New features:
- CL/225298: types/known: implement first-class WKT support
- CL/237219: types/dynamicpb: add NewEnumType
Minor changes:
- CL/238002: reflect/protoreflect: optimize Name.IsValid and FullName.IsValid
- CL/239339: cmd/protoc-gen-go: use of --version flag exits with 0
Bug fixes:
- CL/236998: encoding/protojson: strict validation of FieldMask serialization
Specialized support for well-known types
This release provides specialized support for well-known types by directly generating methods and functions into the generated package for certain well-known types that improve the usability of such types. The additionally generated APIs are listed below.
-
Package
anypb
: New, MarshalFrom, UnmarshalTo, UnmarshalNew, Any.MessageIs, Any.MessageName, Any.MarshalFrom, Any.UnmarshalTo, Any.UnmarshalNew -
Package
timestamppb
: Now, New, Timestamp.AsTime, Timestamp.IsValid, Timestamp.CheckValid -
Package
durationpb
: New, Duration.AsDuration, Duration.IsValid, Duration.CheckValid -
Package
structpb
: NewStruct, Struct.AsMap, Struct.MarshalJSON, Struct.UnmarshalJSON, NewList, ListValue.AsSlice, ListValue.MarshalJSON, ListValue.UnmarshalJSON, NewValue, NewNullValue, NewBoolValue, NewNumberValue, NewStringValue, NewStructValue, NewListValue, Value.AsInterface, Value.MarshalJSON, Value.UnmarshalJSON -
Package
fieldmaskpb
New,, Union,, Intersect,, FieldMask.IsValid,, FieldMask.Append,, FieldMask.Normalize, -
Package
wrapperspb
Bool, Int32, Int64, UInt32, UInt64, Float, Double, String, Bytes
Upcoming breakage changes
There are no new upcoming breaking changes to announce in this release.
As a reminder, the following have already been announced and may take effect in the near future:
- Deprecations announced on 2020-03-02 with the v1.20.0 release