Skip to content

Commit 2ebfa57

Browse files
committed
Fix compliation error
1 parent f388b31 commit 2ebfa57

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

parser.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -617,11 +617,7 @@ import (
617617
type {{.GoName}} string
618618
619619
func (e *{{.GoName}}) Scan(v interface{}) error {
620-
bytes, ok := v.([]byte)
621-
if !ok {
622-
return err
623-
}
624-
*e = {{.GoName}}(string(bytes))
620+
*e = {{.GoName}}(string(v.([]byte)))
625621
return nil
626622
}
627623

testdata/ondeck/db.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import (
1010
type StatusEnum string
1111

1212
func (e *StatusEnum) Scan(v interface{}) error {
13-
bytes, ok := v.([]byte)
14-
if !ok {
15-
return err
16-
}
17-
*e = StatusEnum(string(bytes))
13+
*e = StatusEnum(string(v.([]byte)))
1814
return nil
1915
}
2016

testdata/ondeck/prepared.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import (
1010
type StatusEnum string
1111

1212
func (e *StatusEnum) Scan(v interface{}) error {
13-
bytes, ok := v.([]byte)
14-
if !ok {
15-
return err
16-
}
17-
*e = StatusEnum(string(bytes))
13+
*e = StatusEnum(string(v.([]byte)))
1814
return nil
1915
}
2016

0 commit comments

Comments
 (0)