godbg
godbg copied to clipboard
Follow pointers and find the value
Suggestion from SonOfMotherDuck on reddit
Is this where importing or forking go-spew as a dependency would be relevant?
I am not sure we need to that -- I think they serve different purposes. My thought initially was just to do something like this:
func getExpValue(exp interface{}) {
if reflect.ValueOf(exp).Kind() == reflect.Ptr {
return *exp
}
return exp
}
That will not work for double pointers. Then you will make that function recursive, and it will not handle cycles. Then you reimplement a large part of go-spew. :)