Understanding basic mechanics

The reflection package allows you to extract the type and value from any interface{} variable. This can be done using the following:

  • Using reflection.TypeOf returns the type of the interface in a reflection.Type  variable.
  • The reflection.ValueOf function returns the value of the interface using the reflection.Value variable.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.4.181