Skip to content

Commit

Permalink
Add deprecated message to NullTime (#1144)
Browse files Browse the repository at this point in the history
* Add deprecated message to NullTime
* remove NullTime from README
  • Loading branch information
shogo82148 committed Aug 16, 2020
1 parent f26d659 commit b5b0ea5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -459,8 +459,6 @@ However, many want to scan MySQL `DATE` and `DATETIME` values into `time.Time` v

**Caution:** As of Go 1.1, this makes `time.Time` the only variable type you can scan `DATE` and `DATETIME` values into. This breaks for example [`sql.RawBytes` support](https://github.com/go-sql-driver/mysql/wiki/Examples#rawbytes).

Alternatively you can use the [`NullTime`](https://godoc.org/github.com/go-sql-driver/mysql#NullTime) type as the scan destination, which works with both `time.Time` and `string` / `[]byte`.


### Unicode support
Since version 1.5 Go-MySQL-Driver automatically uses the collation ` utf8mb4_general_ci` by default.
Expand Down
4 changes: 4 additions & 0 deletions nulltime_go113.go
Expand Up @@ -28,4 +28,8 @@ import (
// }
//
// This NullTime implementation is not driver-specific
//
// Deprecated: NullTime doesn't honor the loc DSN parameter.
// NullTime.Scan interprets a time as UTC, not the loc DSN parameter.
// Use sql.NullTime instead.
type NullTime sql.NullTime

0 comments on commit b5b0ea5

Please sign in to comment.