func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error {
	proto.Reset(m)

	if o.Resolver == nil {
		o.Resolver = protoregistry.GlobalTypes
	}

	dec := decoder{json.NewDecoder(b), o}
	if err := dec.unmarshalMessage(m.ProtoReflect(), false); err != nil {
		return err
	}

	// Check for EOF.
	tok, err := dec.Read()
	if err != nil {
		return err
	}
	if tok.Kind() != json.EOF {
		return dec.unexpectedTokenError(tok)
	}

	if o.AllowPartial {
		return nil
	}
	return proto.CheckInitialized(m)
}
// Unmarshal reads the given []byte and populates the given proto.Message using
// options in UnmarshalOptions object. It will clear the message first before
// setting the fields. If it returns an error, the given message may be
// partially set.
Unmarshal reads the given []byte and populates the given proto.Message using
options in UnmarshalOptions object. It will clear the message first before
setting the fields. If it returns an error, the given message may be
partially set.
// Unmarshal reads the given [] byte and populates the given proto . Message using // options in UnmarshalOptions object . It will clear the message first before // setting the fields . If it returns an error the given message may be // partially set .
func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error {
	proto.Reset(m)
	if o.Resolver == nil {
		o.Resolver = protoregistry.GlobalTypes
	}
	dec := decoder{json.NewDecoder(b), o}
	if err := dec.unmarshalMessage(m.ProtoReflect(), false); err != nil {
		return err
	}
	tok, err := dec.Read()
	if err != nil {
		return err
	}
	if tok.Kind() != json.EOF {
		return dec.unexpectedTokenError(tok)
	}
	if o.AllowPartial {
		return nil
	}
	return proto.CheckInitialized(m)
}
func ( o UnmarshalOptions ) Unmarshal ( b [ ] byte , m proto . Message ) error { proto . Reset ( m ) if o . Resolver == nil { o . Resolver = protoregistry . GlobalTypes } dec := decoder { json . NewDecoder ( b ) , o } if err := dec . unmarshalMessage ( m . ProtoReflect ( ) , false ) ; err != nil { return err } tok , err := dec . Read ( ) if err != nil { return err } if tok . Kind ( ) != json . EOF { return dec . unexpectedTokenError ( tok ) } if o . AllowPartial { return nil } return proto . CheckInitialized ( m ) }
Unmarshal reads the given []byte and populates the given proto.Message using
options in UnmarshalOptions object.
Unmarshal reads the given [] byte and populates the given proto . Message using options in UnmarshalOptions object .
// Check for EOF.