Skip to main content

UnmarshalStructToObj

Unmarshals a struct to the passed object. Do not use this if the unmarshalled object is a proto message.

def UnmarshalStructToObj(
structObj: *structpb.Struct,
obj: interface{}
) - > error

Unmarshals a struct to the passed object. Do not use this function if the unmarshalled object is a proto message.

Parameters

NameTypeDescription
structObj*structpb.StructThe source structpb.Struct object to be unmarshaled. This object must not be nil.
objinterface{}The target object into which the data from structObj will be unmarshaled. This object should not be a proto message.

Returns

TypeDescription
errorAn error if the struct object is nil, or if marshaling/unmarshaling fails.