Skip to content

Commit 68972f7

Browse files
authored
fix: Implementing sql/driver/Valuer using a value receiver #276 (#277)
closed #276
2 parents 26cb9ec + 0e7d81a commit 68972f7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

database.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (t *DateTime) Scan(src interface{}) error {
8989
}
9090

9191
// Value the interface providing the Value method for package database/sql/driver.
92-
func (t *DateTime) Value() (driver.Value, error) {
92+
func (t DateTime) Value() (driver.Value, error) {
9393
if t.IsZero() {
9494
return nil, nil
9595
}
@@ -133,7 +133,7 @@ func (t *DateTimeMilli) Scan(src interface{}) error {
133133
}
134134

135135
// Value the interface providing the Value method for package database/sql/driver.
136-
func (t *DateTimeMilli) Value() (driver.Value, error) {
136+
func (t DateTimeMilli) Value() (driver.Value, error) {
137137
if t.IsZero() {
138138
return nil, nil
139139
}
@@ -177,7 +177,7 @@ func (t *DateTimeMicro) Scan(src interface{}) error {
177177
}
178178

179179
// Value the interface providing the Value method for package database/sql/driver.
180-
func (t *DateTimeMicro) Value() (driver.Value, error) {
180+
func (t DateTimeMicro) Value() (driver.Value, error) {
181181
if t.IsZero() {
182182
return nil, nil
183183
}
@@ -221,7 +221,7 @@ func (t *DateTimeNano) Scan(src interface{}) error {
221221
}
222222

223223
// Value the interface providing the Value method for package database/sql/driver.
224-
func (t *DateTimeNano) Value() (driver.Value, error) {
224+
func (t DateTimeNano) Value() (driver.Value, error) {
225225
if t.IsZero() {
226226
return nil, nil
227227
}
@@ -265,7 +265,7 @@ func (t *Date) Scan(src interface{}) error {
265265
}
266266

267267
// Value the interface providing the Value method for package database/sql/driver.
268-
func (t *Date) Value() (driver.Value, error) {
268+
func (t Date) Value() (driver.Value, error) {
269269
if t.IsZero() {
270270
return nil, nil
271271
}
@@ -309,7 +309,7 @@ func (t *DateMilli) Scan(src interface{}) error {
309309
}
310310

311311
// Value the interface providing the Value method for package database/sql/driver.
312-
func (t *DateMilli) Value() (driver.Value, error) {
312+
func (t DateMilli) Value() (driver.Value, error) {
313313
if t.IsZero() {
314314
return nil, nil
315315
}
@@ -353,7 +353,7 @@ func (t *DateMicro) Scan(src interface{}) error {
353353
}
354354

355355
// Value the interface providing the Value method for package database/sql/driver.
356-
func (t *DateMicro) Value() (driver.Value, error) {
356+
func (t DateMicro) Value() (driver.Value, error) {
357357
if t.IsZero() {
358358
return nil, nil
359359
}
@@ -397,7 +397,7 @@ func (t *DateNano) Scan(src interface{}) error {
397397
}
398398

399399
// Value the interface providing the Value method for package database/sql/driver.
400-
func (t *DateNano) Value() (driver.Value, error) {
400+
func (t DateNano) Value() (driver.Value, error) {
401401
if t.IsZero() {
402402
return nil, nil
403403
}
@@ -441,7 +441,7 @@ func (t *Time) Scan(src interface{}) error {
441441
}
442442

443443
// Value the interface providing the Value method for package database/sql/driver.
444-
func (t *Time) Value() (driver.Value, error) {
444+
func (t Time) Value() (driver.Value, error) {
445445
if t.IsZero() {
446446
return nil, nil
447447
}
@@ -487,7 +487,7 @@ func (t *TimeMilli) Scan(src interface{}) error {
487487
}
488488

489489
// Value the interface providing the Value method for package database/sql/driver.
490-
func (t *TimeMilli) Value() (driver.Value, error) {
490+
func (t TimeMilli) Value() (driver.Value, error) {
491491
if t.IsZero() {
492492
return nil, nil
493493
}
@@ -532,7 +532,7 @@ func (t *TimeMicro) Scan(src interface{}) error {
532532
}
533533

534534
// Value the interface providing the Value method for package database/sql/driver.
535-
func (t *TimeMicro) Value() (driver.Value, error) {
535+
func (t TimeMicro) Value() (driver.Value, error) {
536536
if t.IsZero() {
537537
return nil, nil
538538
}
@@ -577,7 +577,7 @@ func (t *TimeNano) Scan(src interface{}) error {
577577
}
578578

579579
// Value the interface providing the Value method for package database/sql/driver.
580-
func (t *TimeNano) Value() (driver.Value, error) {
580+
func (t TimeNano) Value() (driver.Value, error) {
581581
if t.IsZero() {
582582
return nil, nil
583583
}
@@ -622,7 +622,7 @@ func (t *Timestamp) Scan(src interface{}) error {
622622
}
623623

624624
// Value the interface providing the Value method for package database/sql/driver.
625-
func (t *Timestamp) Value() (driver.Value, error) {
625+
func (t Timestamp) Value() (driver.Value, error) {
626626
if t.IsZero() {
627627
return nil, nil
628628
}
@@ -667,7 +667,7 @@ func (t *TimestampMilli) Scan(src interface{}) error {
667667
}
668668

669669
// Value the interface providing the Value method for package database/sql/driver.
670-
func (t *TimestampMilli) Value() (driver.Value, error) {
670+
func (t TimestampMilli) Value() (driver.Value, error) {
671671
if t.IsZero() {
672672
return nil, nil
673673
}
@@ -712,7 +712,7 @@ func (t *TimestampMicro) Scan(src interface{}) error {
712712
}
713713

714714
// Value the interface providing the Value method for package database/sql/driver.
715-
func (t *TimestampMicro) Value() (driver.Value, error) {
715+
func (t TimestampMicro) Value() (driver.Value, error) {
716716
if t.IsZero() {
717717
return nil, nil
718718
}
@@ -757,7 +757,7 @@ func (t *TimestampNano) Scan(src interface{}) error {
757757
}
758758

759759
// Value the interface providing the Value method for package database/sql/driver.
760-
func (t *TimestampNano) Value() (driver.Value, error) {
760+
func (t TimestampNano) Value() (driver.Value, error) {
761761
if t.IsZero() {
762762
return nil, nil
763763
}

0 commit comments

Comments
 (0)