You could either use the deprecated
https://pkg.go.dev/github.com/golang/protobuf/jsonpb#UnmarshalNext

Or you could use a similar strategy
https://github.com/golang/protobuf/blob/v1.5.2/jsonpb/decode.go#L77-L81
paired with
https://pkg.go.dev/google.golang.org/protobuf/encoding/protojson#Unmarshal

On Mon, Apr 12, 2021 at 10:49 AM ramsa <[email protected]> wrote:

>   Hi,
>
> Are there any readme or know examples of the application (sample code)
> that we can refer to better understand the application of the protojson
> application. If so can you please share the link,
>
> https://pkg.go.dev/google.golang.org/protobuf/encoding/protojson
>
> I want to read from a stream of json inputs and convert it to the protobuf
> format.
>
> Thanks
> R
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/f67fa263-d17a-44f3-bd15-9418335f0924n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/f67fa263-d17a-44f3-bd15-9418335f0924n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAG3-gN%3Dz-D30u7zbu5qHAV1QhTCpdZpxTOBmun1kV9_by4F52Q%40mail.gmail.com.

Reply via email to