%#v main.MyError{error:error(nil)}
%+v %!v(PANIC=runtime error: invalid memory address or nil pointer dereference)
%v %!v(PANIC=runtime error: invalid memory address or nil pointer dereference)I think MyError has the Error method, which %v will use but %#v will not. Then it panics because it's trying to call error(nil).Error().
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
%#v main.MyError{error:error(nil)}
%+v %!v(PANIC=runtime error: invalid memory address or nil pointer dereference)
%v %!v(PANIC=runtime error: invalid memory address or nil pointer dereference)
%#v main.MyError2{foo:0, err:error(nil)}
%+v {foo:0 err:<nil>}
%v {0 <nil>}
%#v <nil>
%+v <nil>
%v <nil>