diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-07-12 05:07:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-11 17:07:52 -0400 |
commit | d08996c7b962f686ce9528e14a65144dc3e5ec21 (patch) | |
tree | b8b93f3d50207137ffa6669b23391fd29cca06ab /vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go | |
parent | 3973a4609ef6efb494699371a719b664fa1da33d (diff) | |
download | gitea-d08996c7b962f686ce9528e14a65144dc3e5ec21.tar.gz gitea-d08996c7b962f686ce9528e14a65144dc3e5ec21.zip |
Upgrade xorm to v1.0.3 (#12210)
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go')
-rw-r--r-- | vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go b/vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go new file mode 100644 index 0000000000..86d159d441 --- /dev/null +++ b/vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go @@ -0,0 +1,34 @@ +// Go MySQL Driver - A MySQL-Driver for Go's database/sql package +// +// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at http://mozilla.org/MPL/2.0/. + +// +build !go1.13 + +package mysql + +import ( + "time" +) + +// NullTime represents a time.Time that may be NULL. +// NullTime implements the Scanner interface so +// it can be used as a scan destination: +// +// var nt NullTime +// err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt) +// ... +// if nt.Valid { +// // use nt.Time +// } else { +// // NULL value +// } +// +// This NullTime implementation is not driver-specific +type NullTime struct { + Time time.Time + Valid bool // Valid is true if Time is not NULL +} |