package example_commands_test import ( "context" "fmt" "github.com/redis/go-redis/v9" ) func ExampleClient_cmd_flushall() { ctx := context.Background() rdb := redis.NewClient(&redis.Options{ Addr: "localhost:6379", Password: "", // no password docs DB: 0, // use default DB }) flushAllResult1, err := rdb.FlushAll(ctx).Result() if err != nil { panic(err) } fmt.Println(flushAllResult1) // >>> OK flus