Skip to content

Commit ce0795b

Browse files
committed
fix: handle error from Close() in isFirstRun
The f.Close() call was ignoring the returned error. Now we log a warning if closing the first-run marker file fails. Fixes #1769 Assisted-By: cagent
1 parent e22db73 commit ce0795b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cmd/root/root.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ func isFirstRun() bool {
311311
if err != nil {
312312
return false // File already exists or other error, not first run
313313
}
314-
f.Close()
314+
if err := f.Close(); err != nil {
315+
slog.Warn("Failed to close first run marker file", "error", err)
316+
}
315317

316318
return true
317319
}

0 commit comments

Comments
 (0)