-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Close analysis.log before generate static-report #415
Conversation
Related to containerless --bulk analysis on Windows. Remove of analysis.log silently failed since it was still opened (which appears on Windows), moving the file `Close()` from `defer` just before generating static-report. Fixes: https://issues.redhat.com/browse/MTA-4307 Signed-off-by: Marek Aufart <[email protected]>
Succesfuly tested this change on Win10. |
The thing here, is that the defer will close the file on all of the error returns. from godoc:
I think that right now we are just throwing away that error, so I would just add back the defer. It will error most times but that will be fine because we are not using it. |
Thanks for feedback @shawn-hurley! Just to be sure I understand correctly you're suggesting putting back file.Close in defer and keep file.Close also before static-report generation, correct? |
That is correct |
Signed-off-by: Marek Aufart <[email protected]>
* Close analysis.log before generate static-report Related to containerless --bulk analysis on Windows. Remove of analysis.log silently failed since it was still opened (which appears on Windows), moving the file `Close()` from `defer` just before generating static-report. Fixes: https://issues.redhat.com/browse/MTA-4307 Signed-off-by: Marek Aufart <[email protected]> * Re-add Close in defer Signed-off-by: Marek Aufart <[email protected]> --------- Signed-off-by: Marek Aufart <[email protected]> Signed-off-by: Cherry Picker <[email protected]>
…419) 🐛 Close analysis.log before generate static-report (#415) * Close analysis.log before generate static-report Related to containerless --bulk analysis on Windows. Remove of analysis.log silently failed since it was still opened (which appears on Windows), moving the file `Close()` from `defer` just before generating static-report. Fixes: https://issues.redhat.com/browse/MTA-4307 * Re-add Close in defer --------- Signed-off-by: Marek Aufart <[email protected]> Signed-off-by: Cherry Picker <[email protected]>
Related to containerless --bulk analysis on Windows. Remove of analysis.log silently failed since it was still opened (which appears on Windows only), moving the file
Close()
fromdefer
to just before generating static-report.If some error occured before reaching the Close, the file should be closed by golang garbage collector.
Fixes: https://issues.redhat.com/browse/MTA-4307