forked from uber-go/zap
-
Notifications
You must be signed in to change notification settings - Fork 0
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. (uber-go#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
1 parent
4ed783f
commit 8c4fdeb
Showing
2 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters