tidwall / redcon

Redis compatible server framework for Go
MIT License
2.19k stars 158 forks source link

fix: []byte nil resp && feature: add WriteBulkFrom with bufio.Writer for Conn interface WriteBulkFrom func #65

Open weedge opened 1 year ago

weedge commented 1 year ago
  1. fix: []byte nil resp // resp "" "" Expect nil, nil arr := [][]byte{nil, nil} conn.WriteAny(arr)

    // need change tmp := []interface{}{} for i := range arr { if arr[i] == nil { tmp = append(tmp, nil) continue } tmp = append(tmp, arr[i]) } conn.WriteAny(tmp)

so when check []byte, if is nil, AppendNull resp

  1. add WriteBulkFrom with bufio.Writer for Conn interface WriteBulkFrom func