forked from seborama/govcr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
31 lines (28 loc) · 999 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"fmt"
"os"
"github.com/seborama/govcr"
)
func runExample(name, cassetteName string, f func()) {
fmt.Println("Running " + name + "...")
fmt.Println("1st run =======================================================")
if err := govcr.DeleteCassette(cassetteName, ""); err != nil {
fmt.Printf("Error deleting cassette '%s' - %s\n", cassetteName, err.Error())
os.Exit(10)
}
f()
fmt.Println("2nd run =======================================================")
f()
fmt.Println("Complete ======================================================")
fmt.Println()
}
func main() {
runExample("Example1", example1CassetteName, Example1)
runExample("Example2", example2CassetteName, Example2)
runExample("Example3", example3CassetteName, Example3)
runExample("Example4", example4CassetteName, Example4)
runExample("Example5", example5CassetteName, Example5)
runExample("Example6", example6CassetteName, Example6)
runExample("Example7", example7CassetteName, Example7)
}