Skip to content

Commit 0ee8fb4

Browse files
committed
[fix] example test
1 parent 67fcf4d commit 0ee8fb4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

example_goblin_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package goblin_test
22

33
import (
4+
"log"
45
"net/http"
56

67
"github.com/bmf-san/goblin"
@@ -44,5 +45,7 @@ func ExampleListenAndServe() {
4445
r.Methods(http.MethodPost).Use(CORS).Handler(`/foo/:name`, FooNameHandler())
4546
r.Methods(http.MethodGet).Handler(`/baz`, BazHandler())
4647

47-
http.ListenAndServe(":9999", r)
48+
if err := http.ListenAndServe(":9999", r); err != nil {
49+
log.Fatal(err)
50+
}
4851
}

0 commit comments

Comments
 (0)