func TestRedis2(t *testing.T) {
	conf := RedisClientConf{
		Address:     "127.0.0.1:6379",
		Password:    "",  
		DB:          0,   
		PoolSize:    10,
		PoolTimeout: 10 * time.Second,
	}
	conf.SetClientName("default")
	client, err := GetRedisClient("default")
	if err != nil {
		panic(err)
	}
	defer client.Close()
	var wg sync.WaitGroup
	for i := 0; i < 5000; i++ {
		wg.Add(1)
		go setData(client, &wg)
	}
	wg.Wait()
	log.Println("ok")
}
=== RUN   TestRedis
PONG <nil>
2019/11/06 22:11:08 OK <nil>
2019/11/06 22:11:08 OK <nil>
2019/11/06 22:11:08 daheige <nil>
--- PASS: TestRedis (0.03s)
PASS
ok  	github.com/daheige/thinkgo/goredis	0.028s

go test -v -test.run=TestRedis2
package goredis
import (
	"fmt"
	"log"
	"strconv"
	"sync"
	"testing"
	"time"
	"github.com/go-redis/redis"
	"github.com/daheige/thinkgo/chanlock"
)
func TestRedis(t *testing.T) {
	conf := RedisClientConf{
		Address:     "127.0.0.1:6379",
		Password:    "",  
		DB:          0,   
		PoolSize:    10,
		PoolTimeout: 10 * time.Second,
	}
	conf.SetClientName("default")
	client, err := GetRedisClient("default")
	if err != nil {
		panic(err)
	}
	defer client.Close()
	pong, err := client.Ping().Result()
	fmt.Println(pong, err)
	err = client.Set("username", "value", 0).Err()
	if err != nil {
		panic(err)
	}
	clusterConf := RedisClusterConf{
		AddressNodes: []string{
			"127.0.0.1:6391",
			"127.0.0.1:6392",
			"127.0.0.1:6393",
			"127.0.0.1:6394",
			"127.0.0.1:6395",
			"127.0.0.1:6396",
		},
		PoolSize:     10,  
		MaxRetries:   2,   
		DialTimeout:  10 * time.Second,
		ReadTimeout:  30 * time.Second,  
		WriteTimeout: 30 * time.Second,
		PoolTimeout:  30 * time.Second,
		MinIdleConns: 10,
		IdleTimeout:  100 * time.Second,
	}
	cluster := clusterConf.GetCluster()
	defer cluster.Close()
	str, err := cluster.Set("username", "daheige", 1000*time.Second).Result()
	log.Println(str, err)
	str, err = cluster.Set("myname", "daheige2", 1000*time.Second).Result()
	log.Println(str, err)
	log.Println(cluster.Get("username").Result())  
}