comments update for package gtime
@@ -4,20 +4,19 @@ import (
"database/sql/driver"
)
-//Scanner is an interface used by Scan.
-//Scan value from database
-//database/sql
+// Scanner is an interface used by Scan in package database/sql for Scanning value
+// from database to local golang variable.
func (t *Time) Scan(value interface{}) error {
if t == nil {
return nil
}
newTime := New(value)
- t.Time = newTime.Time
+ *t = *newTime
return nil
}
-// Valuer is the interface providing the Value method. database/sql/driver
-// Value insert into mysql need this function.
+// Value is the interface providing the Value method for package database/sql/driver
+// for retrieving value from golang variable to database.
func (t *Time) Value() (driver.Value, error) {
if t == nil {
return nil, nil
