Open hiqsociety opened 3 years ago
No. You will need to call WriteArray, which writes the number of items in the array first. If you don't know how many items there will be then you can buffer them like:
// buffer and count the items
var count int
var buf bufio.Buffer
w := redcon.NewWriter(&buf)
for it.Seek(); it.Valid(); it.Next() {
w.WriteBulk(it.Key.Data())
count++
}
// write the array header and the buffered items.
conn.WriteArray(count)
conn.WriteRaw(buf.Bytes())
Then wr
if i'm getting data from db, is this possible without pre specifying with WriteArray() first?
for it.Seek(); it.Valid(); it.Next() { conn.WriteBulk([]byte, it.Key.Data()) }