This repository has been archived by the owner on Feb 24, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For nulls.Time, decode empty value as NULL
This commit adds a check during decoding which will return `nulls.Time` as a NULL value (i.e. its value for `Valid` will be false). Without this check, the value of nulls.Time{} will be: ``` { Time: 0001-01-01 00:00:00 +0000 UTC, Valid: true, } ``` This ends up storing the value `0001-01-01 00:00:00 +0000 UTC` in the database, as opposed to a NULL value.
- Loading branch information
1 parent
578e4d0
commit 0ed3bfe
Showing
2 changed files
with
15 additions
and
0 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