Skip to content

Commit 4641e77

Browse files
committed
Switch to log.Panic to make exit-after-defer lint happy
1 parent 635404f commit 4641e77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

example_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import (
1111
func Example() {
1212
db, err := Open("test-data/test-data/GeoIP2-City-Test.mmdb")
1313
if err != nil {
14-
log.Fatal(err)
14+
log.Panic(err)
1515
}
1616
defer db.Close()
1717
// If you are using strings that may be invalid, check that ip is not nil
1818
ip := net.ParseIP("81.2.69.142")
1919
record, err := db.City(ip)
2020
if err != nil {
21-
log.Fatal(err)
21+
log.Panic(err)
2222
}
2323
fmt.Printf("Portuguese (BR) city name: %v\n", record.City.Names["pt-BR"])
2424
fmt.Printf("English subdivision name: %v\n", record.Subdivisions[0].Names["en"])

0 commit comments

Comments
 (0)