redis_test.go 367 B

123456789101112131415161718192021222324
  1. package test
  2. import (
  3. "fmt"
  4. "github.com/zeromicro/go-zero/core/stores/redis"
  5. "testing"
  6. )
  7. func TestName(t *testing.T) {
  8. newRedis, err := redis.NewRedis(redis.RedisConf{
  9. Host: "10.8.230.17:6379",
  10. Type: "node",
  11. Pass: "",
  12. Tls: false,
  13. NonBlock: false,
  14. })
  15. if err != nil {
  16. fmt.Println(err)
  17. } else {
  18. fmt.Println(newRedis.Ping())
  19. }
  20. }