-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix/scan issues #84
Fix/scan issues #84
Conversation
Signed-off-by: Andrea Waltlova <[email protected]>
Signed-off-by: Andrea Waltlova <[email protected]>
Signed-off-by: Andrea Waltlova <[email protected]>
src/main.go
Outdated
@@ -35,6 +35,7 @@ func main() { | |||
|
|||
config = loadConfigOrDefault(configFilePath) | |||
log.Infoln("Configuration loaded: ", config) | |||
defer os.RemoveAll(*config.TemporaryWorkerDirectory) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this, but I noticed that we do not remove the temporaryWorkerDirectory
(and any remaining content), what do you think about it @r0x0d ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are a few things for us to answer here before saying yes
or no
:
- Do we want to remove the directory even if it is user specified?
- The contents inside that folder are deleted at the end of the execution, right? So I believe that there won't be anything inside that folder (for now)?
I'm in favor of deleting the temporary directory, as it is really what it proposes, a temporary directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think it was created with a intention to be only temporary, and you are right that it should be empty, so this should just take care of removing the folder itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, if there is nothing else in that folder after we finish the script execution, I'm in favor of removing it. Otherwise, I think we should leave the folder there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to os.Remove
that should keep the folder if something is inside
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #84 +/- ##
==========================================
- Coverage 67.34% 65.12% -2.22%
==========================================
Files 5 5
Lines 343 347 +4
==========================================
- Hits 231 226 -5
- Misses 95 101 +6
- Partials 17 20 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented on the threads, but the code looks good so far.
os.Remove instead of os.RemoveAll
HMS-2552