I am looking for an answer to this one:
the question says:
I have this func:
func getStringRepresentation(v interface{}, size int, brk bool, depth int) string {
val := reflect.ValueOf(v)
if val.Kind() == reflect.Ptr {
v = *v.(types.Pointer) // does not work
val = reflect.ValueOf(v)
}
// ...
}
how can I dereference the pointer to get the value of it? When I use:
v = *v.(types.Pointer)
The error says:
Invalid indirect of ‘v.(types.Pointer)’ (type ‘types.Pointer’)