1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-24 08:02:32 +02:00

Removed DefaultTable() from global vars

We will not initialize DefaultTable as global var unless the users asks
for it explicitly.
This commit is contained in:
Milos Gajdos 2019-06-07 18:04:48 +01:00
parent d7f0db04ec
commit ad92e6821e
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F
2 changed files with 2 additions and 8 deletions

View File

@ -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 {

View File

@ -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