Closed jogramming closed 5 years ago
Hi,
AddString
and String
are the same, they are meant to be used within an UnmarshalJSON[Object|Array]
method.
DecodeString
is meant to be used at a root decoding method.
Example:
var jsonString = strings.NewReader(`"foobar"`)
var str string
var dec = NewDecoder(jsonString)
var err = dec.DecodeString(&str)
There's 3 variations of all the methods, they all have the same comments but reading the source they seem to do different things?
example:
Decoder.DecodeString Decoder.AddString Decoder.String
Which ones should i use?