Skip to content

Commit

Permalink
handle error lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MakMuftic committed Mar 13, 2024
1 parent 25ca19e commit 8495fac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ func main() {
metricsServer := metrics.NewServer(metrics.Config{Port: uint(config.Metrics.Port)})
go func() {
err = metricsServer.Start()
defer metricsServer.Stop()
defer func(metricsServer *metrics.Server) {
err := metricsServer.Stop()
if err != nil {
fmt.Fprintf(os.Stderr, "error stopping metrics server: %v\n", err)
}
}(metricsServer)
if err != nil {
fmt.Fprintf(os.Stderr, "error starting metrics server: %v\n", err)
}
Expand Down

0 comments on commit 8495fac

Please sign in to comment.