-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
json: Don't panic for nil Encode{Time, Duration} (#835)
Fixes #834 The JSON encoder assumes that encoders for `time.Time` and `time.Duration` are always specified, which causes nil pointer dereference panics. Fix this by treating nil encoders for time and duration as no-ops. This will fall back to existing logic in the JSON encoder that handles no-op time and duration encoders.
- Loading branch information
Showing
2 changed files
with
43 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