You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, if I want to update a product's title but not the price, I can just set the Title and leave the Price unpopulated. How to achieve this without pointer (proto3)? Thanks.
// proto2
type Product struct {
Title *string
Price *int64
}
// proto3
type Product struct {
Title string
Price int64
}
The text was updated successfully, but these errors were encountered:
proto3 does not allow application code to distinguish between unset and default scalar values. (This is true across proto3 implementations in all languages, not just in Go.)
For encoding incremental updates to messages, use FieldMask.
As described in https://developers.google.com/protocol-buffers/docs/reference/go-generated#singular-scalar-proto2, the field type changed from pointer to raw type.
For example, if I want to update a product's title but not the price, I can just set the
Title
and leave thePrice
unpopulated. How to achieve this without pointer (proto3)? Thanks.The text was updated successfully, but these errors were encountered: