Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

weedge
Copy link

@weedge weedge commented Jun 13, 2023

  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

buff use io buffer write to w(io.Writer)
for io.Copy r(io.Reader) to w(io.Writer)

Signed-off-by: weedge <[email protected]>
@weedge weedge changed the title fix: []byte nil resp fix: []byte nil resp && feature: add WriteBulkFrom with bufio.Writer for Conn interface WriteBulkFrom func Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant