Created
December 28, 2017 19:59
-
-
Save jonbodner/36ed810633d731bee602584e8694910b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (d *decodeState) unmarshal(v interface{}) (err error) { | |
<skip over some setup> | |
rv := reflect.ValueOf(v) | |
if rv.Kind() != reflect.Ptr || rv.IsNil() { | |
return &InvalidUnmarshalError{reflect.TypeOf(v)} | |
} | |
d.scan.reset() | |
// We decode rv not rv.Elem because the Unmarshaler interface | |
// test must be applied at the top level of the value. | |
d.value(rv) | |
return d.savedError | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment