소스 검색

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)
 		}