Skip to content

Commit 960d801

Browse files
committed
canonical code
1 parent 2b5d5e0 commit 960d801

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

go/sql/types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ func (this *Column) convertArg(arg interface{}) interface{} {
5252
}
5353

5454
if this.Type == BinaryColumnType {
55-
size := len([]byte(arg.(string)))
55+
arg2Bytes := []byte(arg.(string))
56+
size := len(arg2Bytes)
5657
if uint(size) < this.BinaryOctetLength {
57-
buf := bytes.NewBuffer([]byte(arg.(string)))
58+
buf := bytes.NewBuffer(arg2Bytes)
5859
for i := uint(0); i < (this.BinaryOctetLength - uint(size)); i++ {
5960
buf.Write([]byte{0})
6061
}

0 commit comments

Comments
 (0)