From ad92e6821eea5a67f1603e3e123a250ac841e307 Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Fri, 7 Jun 2019 18:04:48 +0100 Subject: [PATCH] Removed DefaultTable() from global vars We will not initialize DefaultTable as global var unless the users asks for it explicitly. --- router/router.go | 8 ++------ router/table.go | 2 -- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/router/router.go b/router/router.go index 72af0979..319b296a 100644 --- a/router/router.go +++ b/router/router.go @@ -1,11 +1,6 @@ // Package router provides an interface for micro network routers package router -var ( - // DefaultRouter returns default micro router - DefaultRouter = NewRouter() -) - // Router is micro network router type Router interface { // Initi initializes Router with options @@ -49,7 +44,8 @@ type QueryOption func(*QueryOptions) func NewRouter(opts ...Option) Router { // set default options ropts := Options{ - Table: DefaultTable, + // Default table + Table: NewTable(), } for _, o := range opts { diff --git a/router/table.go b/router/table.go index 1f2de4d3..931ee9a2 100644 --- a/router/table.go +++ b/router/table.go @@ -6,8 +6,6 @@ import ( ) var ( - // DefaultRouter returns default micro router - DefaultTable = NewTable() // ErrRouteNotFound is returned when no route was found ErrRouteNotFound = errors.New("route not found") // ErrDuplicateRoute is return when route already exists