go-hibp/examples/breaches-api/all-breaches-nounverified/main.go

26 lines
449 B
Go
Raw Normal View History

2021-09-22 09:46:18 +02:00
package main
import (
"fmt"
"github.com/wneessen/go-hibp"
2021-09-22 09:46:18 +02:00
)
func main() {
hc := hibp.New()
bl, _, err := hc.BreachApi.Breaches()
if err != nil {
panic(err)
}
if bl != nil && len(bl) != 0 {
fmt.Printf("Found %d breaches total.\n", len(bl))
}
bl, _, err = hc.BreachApi.Breaches(hibp.WithoutUnverified())
if err != nil {
panic(err)
}
if bl != nil && len(bl) != 0 {
fmt.Printf("Found %d verified breaches total.\n", len(bl))
}
}