switch to gofumpt
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2020-10-10 15:08:37 +00:00
parent 3da597f4ba
commit 2b428230b2
5 changed files with 12 additions and 16 deletions

View File

@@ -122,12 +122,11 @@ func (s *server) serve() int {
go s.serveUntilShutdown()
for range s.ctx.Done() {
//aforementioned clean shutdown upon main context
//cancellation
// aforementioned clean shutdown upon main context
// cancellation
}
s.cleanShutdown()
return s.exitCode
}
func (s *server) cleanupForExit() {
@@ -171,7 +170,7 @@ func (s *server) configure() {
viper.AddConfigPath(fmt.Sprintf("/etc/%s", s.appname))
// call multiple times to add many search paths:
viper.AddConfigPath(fmt.Sprintf("$HOME/.config/%s", s.appname))
//viper.SetEnvPrefix(strings.ToUpper(s.appname))
// viper.SetEnvPrefix(strings.ToUpper(s.appname))
viper.AutomaticEnv()
viper.SetDefault("DEBUG", "false")
@@ -250,7 +249,7 @@ func (s *server) setupLogging() {
logger := zerolog.New(multi).With().Timestamp().Logger().With().Caller().Logger()
s.log = &logger
//log.Logger = logger
// log.Logger = logger
if viper.GetBool("debug") {
zerolog.SetGlobalLevel(zerolog.DebugLevel)

View File

@@ -66,11 +66,9 @@ func (s *server) LoggingMiddleware() func(http.Handler) http.Handler {
Int("status", lrw.statusCode).
Int("latency_ms", int(latency.Milliseconds())).
Send()
}()
next.ServeHTTP(lrw, r)
})
}
}
@@ -118,5 +116,4 @@ func (s *server) MetricsAuthMiddleware() func(http.Handler) http.Handler {
},
},
)
}

View File

@@ -12,7 +12,6 @@ import (
)
func (s *server) routes() {
s.router = chi.NewRouter()
// the mux .Use() takes a http.Handler wrapper func, like most
@@ -93,5 +92,4 @@ func (s *server) routes() {
r.Get("/metrics", http.HandlerFunc(promhttp.Handler().ServeHTTP))
})
}
}