Skip to content

Instantly share code, notes, and snippets.

@jonbodner
Last active December 28, 2017 20:06
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/bec2fcdf148a7663f87fd951636f4513 to your computer and use it in GitHub Desktop.
Save jonbodner/bec2fcdf148a7663f87fd951636f4513 to your computer and use it in GitHub Desktop.
subv = v
destring = f.quoted
for _, i := range f.index {
if subv.Kind() == reflect.Ptr {
if subv.IsNil() {
subv.Set(reflect.New(subv.Type().Elem()))
}
subv = subv.Elem()
}
subv = subv.Field(i)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment