使用for循环将键和值复制到切片:
var pairs []interface{} for i := range keys { pairs = append(pairs, keys[i], values[i]) } cmd := c.MSet(pairs...)