Skip to content

Instantly share code, notes, and snippets.

@jonbodner
Created December 28, 2017 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonbodner/4c865b4a5f46697668fc349537c4a503 to your computer and use it in GitHub Desktop.
Save jonbodner/4c865b4a5f46697668fc349537c4a503 to your computer and use it in GitHub Desktop.
// Decoding into nil interface? Switch to non-reflect code.
if v.Kind() == reflect.Interface && v.NumMethod() == 0 {
v.Set(reflect.ValueOf(d.objectInterface()))
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment