Skip to main content

UnmarshalBytesToPb

Unmarshals a byte slice to a proto message.

def UnmarshalBytesToPb(
b: []byte,
msg: proto.Message
) - > error

Unmarshals a byte slice to a proto message.

Parameters

NameTypeDescription
b[]byteThe byte slice containing the data to be unmarshaled into the proto message.
msgproto.MessageThe proto message into which the bytes will be unmarshaled. This message will be populated with the data from the byte slice.

Returns

TypeDescription
errorAn error if the unmarshaling fails, otherwise nil.