| 1234567891011121314151617181920212223242526272829303132333435 |
- package test
- import (
- "fmt"
- "github.com/zeromicro/go-zero/core/stores/redis"
- "testing"
- )
- func TestName(t *testing.T) {
- newRedis, err := redis.NewRedis(redis.RedisConf{
- Host: "10.8.230.17:6379",
- Type: "node",
- Pass: "",
- Tls: false,
- NonBlock: false,
- })
- if err != nil {
- fmt.Println(err)
- } else {
- fmt.Println(newRedis.Ping())
- }
- }
- func Test2(t *testing.T) {
- var a = '好'
- fmt.Printf("character %c,unicode %U binary %016b\n", a, a, a)
- var b = "好"
- for _, i := range []byte(b) {
- fmt.Printf("binary %b\n", i)
- }
- for _, i := range b {
- fmt.Printf("binary %b\n", i)
- }
- }
|