So, given the function xml.MarshalIndent(xmlLiteralFromStruct, "", " ")
, which returns a []byte
and an error
, you could assign 2 variables to the two return values with shorthand syntax like so:
xmlEncodedMsg, err := xml.MarshalIndent(xmlLiteralFromStruct, "", " ")
My question is (and I know this code doesn't work, but hopefully you can see what I'm trying to do) is there a way to explicitly declare both variables and their types similar to this:
var xmlEncodedMsg, err ([]byte, error) = xml.MarshalIndent(msg, "", " ")
Thanks in advance for any suggestions