Browse Source

reflect.Value.Bytes() should only be called when reflect.Value.Kind() is reflect.Slice, and not reflect.Array

Unknown 6 years ago
parent
commit
bb4f9bf202
1 changed files with 1 additions and 1 deletions
  1. 1 1
      session_convert.go

+ 1 - 1
session_convert.go

@@ -640,7 +640,7 @@ func (session *Session) value2Interface(col *core.Column, fieldValue reflect.Val
 		} else if col.SQLType.IsBlob() {
 			var bytes []byte
 			var err error
-			if (k == reflect.Array || k == reflect.Slice) &&
+			if (k == reflect.Slice) &&
 				(fieldValue.Type().Elem().Kind() == reflect.Uint8) {
 				bytes = fieldValue.Bytes()
 			} else {