Catch panics when calling GoString like fmt %#v does (#87)

This handles a few cases (similar to how fmt %#v does):

- A GoString method on a value receiver, called with a nil pointer
- A GoString method on a pointer receiver that doesn't check for nil
- A GoString method that panics in some other way

Because Go 1.17 added a method Time.GoString with value receiver, this
broke structs that had *time.Time fields with nil values (which is

Also added a bunch of tests for these cases.

Fixes #77

Co-authored-by: Jordan Barrett <>
3 files changed