improve code quality

This commit is contained in:
Astone
2019-12-03 15:25:58 +08:00
parent b5d65305db
commit 29fb58db39
20 changed files with 67 additions and 89 deletions

View File

@@ -718,7 +718,7 @@ func (r *router) Process(a *Advert) error {
route := event.Route
action := event.Type
log.Debugf("Router %s applying %s from router %s for service %s %s", r.options.Id, action, route.Router, route.Service, route.Address)
if err := r.manageRoute(route, fmt.Sprintf("%s", action)); err != nil {
if err := r.manageRoute(route, action.String()); err != nil {
return fmt.Errorf("failed applying action %s to routing table: %s", action, err)
}
}