This repository has been archived by the owner on Feb 16, 2024. It is now read-only.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CarsonSlovoka
commented
Mar 22, 2022
I'm not fully satisfied with the way you've implemented this feature. Here's how I would do things:
func() (err error) {
if err = os.RemoveAll(p.AstilectronDownloadDst()); err != nil {
err = fmt.Errorf("removing %s failed: %w", p.AstilectronDownloadDst(), err)
return
}
}
// Move
var closeFunc func() error
if err = m(ctx, paths); err != nil {
return fmt.Errorf("moving %s failed: %w", name, err)
}
// Make sure to close
defer func() {
if err := closeFunc(); err != nil {
// Only log the error
p.l.Error(fmt.Errorf("closing failed: %w", err))
return
}
}() |
…ror, error) delete the zip on the mover. asticode#358 (comment)
put the test code together.
asticode
suggested changes
Mar 25, 2022
Thank you for taking the time to help me do the code review. If you feel that teaching me is too slow, you can directly change it doesn't matter. I will then observe how you are dealing with it. |
asticode
suggested changes
Mar 28, 2022
asticode
suggested changes
Mar 28, 2022
Thanks for this PR 👍 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for issue #347
I have written a test, run under windows can pass the test.