Change optionalEndpoints to endpointOverride
This commit is contained in:
parent
4b6b04259f
commit
cd1ea7c7cb
@ -22,13 +22,13 @@ type Router struct {
|
|||||||
Endpoints
|
Endpoints
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewRouter(r *router.Router, logger log.Logger, optionalEndpoints ...Endpoints) (ro *Router) {
|
func NewRouter(r *router.Router, logger log.Logger, endpointOverride ...Endpoints) (ro *Router) {
|
||||||
var endpoints Endpoints
|
var endpoints Endpoints
|
||||||
if r == nil {
|
if r == nil {
|
||||||
r = router.NewRouter(nil, nil)
|
r = router.NewRouter(nil, nil)
|
||||||
}
|
}
|
||||||
if len(optionalEndpoints) == 1 {
|
if len(endpointOverride) == 1 {
|
||||||
endpoints = optionalEndpoints[0]
|
endpoints = endpointOverride[0]
|
||||||
} else {
|
} else {
|
||||||
endpoints = defaultEndpoints
|
endpoints = defaultEndpoints
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user