aboutsummaryrefslogtreecommitdiff
path: root/pkg/commands/ping.go
blob: b56cd200f1309dbc119ba26e54c2718934c3b93c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package commands

import (
	"errors"
	"redisClone/pkg/core"
)

func Ping(args []string, getShard func(k string) *core.Shard) interface{} {
	if len(args) == 1 {
		return core.SimpleString("PONG")
	}
	if len(args) == 2 {
		return args[1]
	}
	return errors.New("wrong number of arguments for 'PING' command")
}