Joe Tsai

Results 341 comments of Joe Tsai

Making a note that this should probably also handle `map[string]*Message`.

When it comes to deriving the Go package paths for generated packages, there's primarily two ways to sensibly do it: 1) encode it in the `.proto` file (which is what...

> [cmp.FilterPath](https://pkg.go.dev/github.com/google/go-cmp/cmp#FilterPath) also requires it to be symmetric. So, yeah. I think we would have to use a IgnoreUnsetFieldsFrom(want) form. Correct, the `cmp` functionality needs to be symmetric, but it...

That's an odd error. Is `pb.Empty` the same one as `"github.com/golang/protobuf/ptypes/empty".Empty` or `"google.golang.org/protobuf/types/known/emptypb".Empty`?

> whether utility functions like ptypes.TimestampProto are being migrated. You'd be interested in https://go-review.googlesource.com/c/protobuf/+/225298

The migration plan for the well-known types is still being worked on. https://go-review.googlesource.com/c/protobuf/+/225298 generates first-class support for well-known types directly into the generated packages.

> Colleagues, the ptypes.MarshalAny and ptypes.UnmarshalAny methods did not migrate You are correct. In the [v1.20.0 release notes](https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.20.0#v1.20-backwards-compatibility), there are several portions of the old API that do not yet...

> thinking I think the best choice might to stay away from the pattern after all, so that we neither reinforce unexpected behavior, or the unexpectedness of the behavior.? It...

It would be simpler as: ```go b, err := io.ReadAll(os.Stdin) ... // handle err err = protojson.Unmarshal(b, &m) ... // handle err ```

If you need to decode a JSON stream, then something similar to what you suggested is the right way to go. You can actually do it more efficiently with `json.RawMessage`:...