July 2019
Intermediate to advanced
458 pages
12h 12m
English
A reflect.Value type also carries information of the type that can be retrieved with the Type method:
func main() { var a interface{} = int64(23) fmt.Println(reflect.TypeOf(a).String()) // int64 fmt.Println(reflect.ValueOf(a).String()) // <int64 Value> fmt.Println(reflect.ValueOf(a).Type().String()) // int64}A full example is available here: https://play.golang.org/p/tmYuMc4AF1T.
Read now
Unlock full access