diff options
| author | alex <[email protected]> | 2026-07-09 20:24:44 +0200 |
|---|---|---|
| committer | alex <[email protected]> | 2026-07-09 20:24:44 +0200 |
| commit | 8f6257e55c2cb8f4c82fe51fbeaa4a8f66dc30ac (patch) | |
| tree | eaf7b5baca0558ad8408fd4dd24169bd7df348cd /redisDB.go | |
| parent | 5cdb2be53d630906bfdfdb97ade81f7602c9fa45 (diff) | |
| download | redis-clone-8f6257e55c2cb8f4c82fe51fbeaa4a8f66dc30ac.tar.xz redis-clone-8f6257e55c2cb8f4c82fe51fbeaa4a8f66dc30ac.zip | |
basic pubsub system
Diffstat (limited to 'redisDB.go')
| -rw-r--r-- | redisDB.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -35,6 +35,13 @@ func serializeRESP(v any) []byte { result = append(result, serializeRESP(val[i])...) } return result + case []any: + size := len(val) + result := []byte(fmt.Sprintf("*%d\r\n", size)) + for i := 0; i < size; i++ { + result = append(result, serializeRESP(val[i])...) + } + return result case map[string]string: size := len(val) result := []byte(fmt.Sprintf("*%d\r\n", size*2)) |
