Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show "<nil>" for nil Stringer. (#854)
In encodeStringer, instead of returning an error when a panic occurs when calling String() on a nil pointer, use the string value "<nil>" like the fmt package does. It is not always possible to handle this case by fixing the implementation of String to not panic. This requires implementing String with a pointer receiver, which doesn't work if you need to be able to call String on non-addressable values.
- Loading branch information