Skip to content

Commit

Permalink
[refactor] rename err to prevent shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
Argannor authored and Soeren-S committed Oct 11, 2024
1 parent 6efa063 commit c59034c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions exporter/prometheusexporter/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ func (pe *prometheusExporter) Start(ctx context.Context, host component.Host) er
mux.Handle("/metrics", pe.handler)
srv, err := pe.config.ToServer(ctx, host, pe.settings, mux)
pe.shutdownFunc = func(ctx context.Context) error {
err := ln.Close()
errLn := ln.Close()
if srv == nil {
return err
return errLn
}
err2 := srv.Shutdown(ctx)
return errors.Join(err, err2)
errSrv := srv.Shutdown(ctx)
return errors.Join(errLn, errSrv)
}
if err != nil {
return err
Expand Down

0 comments on commit c59034c

Please sign in to comment.