瀏覽代碼

Scan skip string when dest is nil

bits01 8 年之前
父節點
當前提交
6492450c7a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      redis/scan.go

+ 2 - 0
redis/scan.go

@@ -187,6 +187,8 @@ func convertAssign(d interface{}, s interface{}) (err error) {
 		switch d := d.(type) {
 		case *string:
 			*d = string(s)
+		case nil:
+			// skip value
 		default:
 			err = cannotConvert(reflect.ValueOf(d), s)
 		}