package commands import ( "errors" "redisClone/pkg/core" ) func Hgetall(args []string, getShard func(k string) *core.Shard) interface{} { key := args[1] s := getShard(key) item, exists := s.Data[key] if !exists { return nil } hash, ok := item.Value.(map[string]string) if !ok { return errors.New("WRONGTYPE Operation against a key holding the wrong kind of value") } return hash }