Added array serialization to encode function. Moved message reading to utils packages as it's used by both server and client

This commit is contained in:
Kelvin Clement Mwinuka
2023-07-01 21:59:41 +08:00
parent eb188deb7b
commit ef140c8427
5 changed files with 103 additions and 60 deletions

View File

@@ -9,6 +9,7 @@ import (
func Decode(raw string) ([]string, error) {
rd := resp.NewReader(bytes.NewBufferString(raw))
res := []string{}
v, _, err := rd.ReadValue()
@@ -16,8 +17,6 @@ func Decode(raw string) ([]string, error) {
return nil, err
}
res := []string{}
if v.Type().String() == "SimpleString" {
return []string{v.String()}, nil
}