func test(c *redis.Client, ch chan struct{}, doneChan chan struct{}, command string, params ...interface{}) { for _ = range ch { r := c.Call(command, params...) if r.Err != nil { fmt.Println(r.Err) os.Exit(1) } } doneChan <- struct{}{} }