Skip to content

Commit 22d937c

Browse files
committed
fix lint warning
1 parent 0381e44 commit 22d937c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

struct_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,14 @@ func (rows testRows) Close() error {
328328
}
329329

330330
func (rows testRows) Scan(dest ...interface{}) error {
331-
if rows == 0 {
331+
switch rows {
332+
case 0:
332333
fmt.Sscan("1234 huandu 1", dest...)
333-
} else if rows == 1 {
334+
case 1:
334335
fmt.Sscan("1234 34 huandu 1456725903636000000", dest...)
335-
} else if rows == 2 {
336+
case 2:
336337
fmt.Sscan("1 1456725903636000000", dest...)
337-
} else {
338+
default:
338339
panic("invalid rows")
339340
}
340341

0 commit comments

Comments
 (0)