go-redis
code:go
package main
import (
"context"
"fmt"
"github.com/go-redis/redis/v8"
)
var ctx = context.Background()
func main() {
rdb := redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Password: "",
DB: 0,
})
keysToDelete := []string{"hoge"}
n, err := rdb.Del(ctx, keysToDelete...).Result()
if err != nil {
fmt.Printf("%v\n", err)
} else {
fmt.Printf("%d\n", n)
}
}