-
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.
Catch panics when calling GoString like fmt %#v does
This handles a few cases (similar to how fmt %#v does): 1. A GoString method on a value receiver, called with a nil pointer 2. A GoString method on a pointer receiver that doesn't check for nil 3. 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 common!). Also added a bunch of tests for these cases. Fixes kr#77
- Loading branch information
Showing
2 changed files
with
51 additions
and
1 deletion.
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