From 7a510ad9bfc03643a76ec8f176350c15e1bbea25 Mon Sep 17 00:00:00 2001 From: bmf-san Date: Mon, 2 Oct 2023 00:07:07 +0900 Subject: [PATCH] [update] use export test pkg --- _examples/main.go => example_goblin_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename _examples/main.go => example_goblin_test.go (94%) diff --git a/_examples/main.go b/example_goblin_test.go similarity index 94% rename from _examples/main.go rename to example_goblin_test.go index 112c823..826cc36 100644 --- a/_examples/main.go +++ b/example_goblin_test.go @@ -1,9 +1,9 @@ -package main +package goblin_test import ( "net/http" - goblin "github.com/bmf-san/goblin" + "github.com/bmf-san/goblin" ) func CORS(next http.Handler) http.Handler { @@ -34,7 +34,7 @@ func BazHandler() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}) } -func main() { +func ExampleListenAndServe() { r := goblin.NewRouter() r.Methods(http.MethodGet).Handler(`/`, RootHandler())