Change optionalEndpoints to endpointOverride

This commit is contained in:
some 2024-10-09 11:54:28 -04:00
parent 4b6b04259f
commit cd1ea7c7cb
Signed by: some
GPG Key ID: 65D0589220B9BFC8

View File

@ -22,13 +22,13 @@ type Router struct {
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
if r == nil {
r = router.NewRouter(nil, nil)
}
if len(optionalEndpoints) == 1 {
endpoints = optionalEndpoints[0]
if len(endpointOverride) == 1 {
endpoints = endpointOverride[0]
} else {
endpoints = defaultEndpoints
}