Minor naming and control flow changes to satisfy golint

This commit is contained in:
Tolga Ceylan
2017-11-02 15:30:07 -07:00
parent d6078f3c8f
commit a530cd9be3
10 changed files with 67 additions and 68 deletions

View File

@@ -90,13 +90,12 @@ func (s *Server) ensureRoute(ctx context.Context, method string, wroute *models.
return *bad, err
}
return routeResponse{"Route successfully created", wroute.Route}, nil
} else {
err := s.changeRoute(ctx, wroute)
if err != nil {
return *bad, err
}
return routeResponse{"Route successfully updated", wroute.Route}, nil
}
err = s.changeRoute(ctx, wroute)
if err != nil {
return *bad, err
}
return routeResponse{"Route successfully updated", wroute.Route}, nil
case http.MethodPatch:
err := s.changeRoute(ctx, wroute)
if err != nil {

View File

@@ -88,7 +88,7 @@ func New(ctx context.Context, ds models.Datastore, mq models.MessageQueue, logDB
LogDB: logDB,
}
setMachineId()
setMachineID()
s.Router.Use(loggerWrap, traceWrap, panicWrap)
s.bindHandlers(ctx)
@@ -167,7 +167,7 @@ func setTracer() {
logrus.WithFields(logrus.Fields{"url": zipkinHTTPEndpoint}).Info("started tracer")
}
func setMachineId() {
func setMachineID() {
port := uint16(viper.GetInt(EnvPort))
addr := whoAmI().To4()
if addr == nil {