func randSet(t *T, c Cmder, count int) (string, map[string]bool) { key := testutil.RandStr() fullMap := map[string]bool{} for i := 0; i < count; i++ { elem := strconv.Itoa(i) fullMap[elem] = true require.Nil(t, c.Cmd("SADD", key, elem).Err) } return key, fullMap }
func randPrefix(t *T, c Cmder, count int) (string, map[string]bool) { prefix := testutil.RandStr() fullMap := map[string]bool{} for i := 0; i < count; i++ { key := prefix + ":" + strconv.Itoa(i) fullMap[key] = true require.Nil(t, c.Cmd("SET", key, "1").Err) } return prefix, fullMap }