为gtime添加scanner和valuer

This commit is contained in:
yys 2021-03-13 14:07:22 +08:00
parent 41f2138b39
commit 17233084f1

17
os/gtime/gtime_sql.go Normal file
View File

@ -0,0 +1,17 @@
package gtime
import (
"database/sql/driver"
)
//add Scanner
func (t *Time) Scan(value interface{}) error {
newTime := New(value)
t.Time = newTime.Time
return nil
}
//add valuer
func (t *Time) Value() (driver.Value, error) {
return t.Time, nil
}