-
Notifications
You must be signed in to change notification settings - Fork 156
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 (#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 common!). Also added a bunch of tests for these cases. Fixes #77 Co-authored-by: Jordan Barrett <[email protected]>
- Loading branch information
1 parent
d928460
commit d8c7eb1
Showing
3 changed files
with
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
_go* | ||
_test* | ||
_obj | ||
/.idea |
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