mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 03:07:45 +08:00
为gtime添加scanner和valuer
This commit is contained in:
parent
41f2138b39
commit
17233084f1
17
os/gtime/gtime_sql.go
Normal file
17
os/gtime/gtime_sql.go
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user