Merge pull request #50311 from thaJeztah/stack_ignore_errs

pkg/stack: suppress some unhandled errors
This commit is contained in:
Sebastiaan van Stijn
2025-07-02 21:55:55 +02:00
committed by GitHub

View File

@@ -30,8 +30,10 @@ func DumpToFile(dir string) (string, error) {
if err != nil {
return "", errors.Wrap(err, "failed to open file to write the goroutine stacks")
}
defer f.Close()
defer f.Sync()
defer func() {
_ = f.Sync()
_ = f.Close()
}()
} else {
f = os.Stderr
}