Skip to content

Instantly share code, notes, and snippets.

@hami9x
Last active August 29, 2015 14:02
Show Gist options
  • Save hami9x/6d9592f8f25613cf7889 to your computer and use it in GitHub Desktop.
Save hami9x/6d9592f8f25613cf7889 to your computer and use it in GitHub Desktop.
reflect
o = reflect.NewAt(reflect.TypeOf(jso.Interface()), unsafe.Pointer(jso.Unsafe())).Elem()
println(o.FieldByName(field).CanInterface()) //It returns true
println(o.FieldByName(field).Interface()) //Uncaught TypeError: Cannot read property 'constructor' of undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment