Skip to content

Commit

Permalink
refactor: remove unnecessary func
Browse files Browse the repository at this point in the history
  • Loading branch information
iamKunalGupta committed May 21, 2024
1 parent 60c2ebc commit bf4d025
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions flow/instrumentation/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,13 @@ func SetupInstrumentation(ctx context.Context, serviceName string, config Config
return err
}

var err error
handleErr := func(inErr error) {
err = errors.Join(inErr, shutdown(ctx))
}

if config.EnableTracing {
traceShutdown, err := tracing.SetupOtelTraceProviderExporter(serviceName)
if err != nil {
handleErr(err)
return shutdown, err
return shutdown, errors.Join(err, shutdown(ctx))
}
shutdownFuncs = append(shutdownFuncs, traceShutdown)
}
// Setup other stuff here in the future like metrics, logs etc
return shutdown, err
return shutdown, nil
}

0 comments on commit bf4d025

Please sign in to comment.