diff --git a/routing.go b/routing.go index 80887b6..09727a6 100644 --- a/routing.go +++ b/routing.go @@ -20,13 +20,13 @@ type RouteInfo struct { Title string } -func NewRouteInfo(method, path, description, title string) (RouteInfo, error) { +func NewRouteInfo(method, path, description, title string) (*RouteInfo, error) { name, err := convertRouteToRouteName(path) if err != nil { - return RouteInfo{}, err + return &RouteInfo{}, err } - return RouteInfo{ + return &RouteInfo{ Method: method, Name: name, Path: path, @@ -43,7 +43,7 @@ type Router struct { cacheTTL time.Duration } -func NewRouter() Router { +func NewRouter() *Router { ttl := 8 * time.Hour cache, err := NewRouteCacheService(WithTTL(ttl)) @@ -51,7 +51,7 @@ func NewRouter() Router { log.Fatal(jerr.Wrap(err, jerr.ErrRouterNotCreated)) } - return Router{cache: cache, cacheTTL: ttl} + return &Router{cache: cache, cacheTTL: ttl} } func (ro *Router) WithRouteInfo(ri RouteInfo, h HandlerFn) http.HandlerFunc {