Skip to content

Commit

Permalink
defer error lint fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Sep 10, 2024
1 parent c313102 commit a4cd70a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (c Configuration) Controller(db *sql.DB, logger *zap.SugaredLogger) *echo.E
configs := c.Environment
if logger == nil {
logger, _ := zap.NewProduction()
defer logger.Sync()
defer func() { _ = logger.Sync() }()
}

e := echo.New()
Expand Down Expand Up @@ -177,7 +177,7 @@ func (c Configuration) Info(logger *zap.SugaredLogger, w io.Writer) {
func (c Configuration) PortErr(logger *zap.SugaredLogger, port uint, err error) {
if logger == nil {
logger, _ := zap.NewProduction()
defer logger.Sync()
defer func() { _ = logger.Sync() }()
}
s := "HTTP"
if port == c.Environment.TLSPort {
Expand Down Expand Up @@ -225,7 +225,7 @@ func (c *Configuration) ShutdownHTTP(e *echo.Echo, logger *zap.SugaredLogger) {
}
if logger == nil {
logger, _ := zap.NewProduction()
defer logger.Sync()
defer func() { _ = logger.Sync() }()
}
// Wait for interrupt signal to gracefully shutdown the server
quit := make(chan os.Signal, 1)
Expand Down Expand Up @@ -277,7 +277,7 @@ func (c *Configuration) Start(e *echo.Echo, logger *zap.SugaredLogger, configs c
}
if logger == nil {
logger, _ := zap.NewProduction()
defer logger.Sync()
defer func() { _ = logger.Sync() }()
}
switch {
case configs.UseTLS() && configs.UseHTTP():
Expand Down Expand Up @@ -337,7 +337,7 @@ func (c *Configuration) StartTLS(e *echo.Echo, logger *zap.SugaredLogger) {
}
if logger == nil {
logger, _ := zap.NewProduction()
defer logger.Sync()
defer func() { _ = logger.Sync() }()
}
port := c.Environment.TLSPort
address := c.address(port)
Expand Down Expand Up @@ -369,7 +369,7 @@ func (c *Configuration) StartTLSLocal(e *echo.Echo, logger *zap.SugaredLogger) {
}
if logger == nil {
logger, _ := zap.NewProduction()
defer logger.Sync()
defer func() { _ = logger.Sync() }()
}
port := c.Environment.TLSPort
address := c.address(port)
Expand Down

0 comments on commit a4cd70a

Please sign in to comment.