| package main | |
| import ( | |
| "fmt" | |
| "github.com/go-redis/redis" | |
| ) | |
| func main() { | |
| client := redis.NewClient(&redis.Options{ | |
| Addr: "localhost:6379", | |
| Password: "", // no password set | |
| DB: 0, // use default DB | |
| }) | |
| pong, _ := client.Ping().Result() | |
| fmt.Println(pong) | |
| client.SetBit("key", 0, 1) | |
| client.SetBit("key", 1, 1) | |
| client.SetBit("key", 2, 0) | |
| client.SetBit("key", 3, 1) | |
| client.SetBit("key", 4, 1) | |
| res := client.Get("bmk").Val() | |
| fmt.Println(res) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment