Skip to content

Commit 69e4e49

Browse files
sallyomclaude
andcommitted
fix: avoid os.Exit bypassing defer in main
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com>
1 parent bd93ca1 commit 69e4e49

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/epp/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ import (
3636
)
3737

3838
func main() {
39+
os.Exit(run())
40+
}
41+
42+
func run() int {
3943
ctx := ctrl.SetupSignalHandler()
4044

4145
// Initialize tracing before creating any spans
@@ -61,6 +65,7 @@ func main() {
6165
if err := runner.NewRunner().
6266
WithCustomCollectors(metrics.GetCollectors()...).
6367
Run(ctx); err != nil {
64-
os.Exit(1)
68+
return 1
6569
}
70+
return 0
6671
}

0 commit comments

Comments
 (0)