Skip to content
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 double task execution with quiet runner option #132

Merged

Conversation

svengreb
Copy link
Owner

@svengreb svengreb commented Jul 9, 2023

Fixes #131

When the `WithRunnerQuiet` option [1] of the `golang` runner [3] or
`WithQuiet` option [2] of the `gotool` runner [4] was set to `true`,
the task passed to their `Run` method [5] was running twice. This was
caused by a missing return statement when the execution finished with a
`error` of value `nil` [^1] [^2].

To fix this bug both code blocks are now returning early with `nil`
instead of keep going on in the code flow.

[1]: https://pkg.go.dev/github.com/svengreb/wand@v0.8.0/pkg/task/golang#WithRunnerQuiet
[2]: https://pkg.go.dev/github.com/svengreb/wand@v0.8.0/pkg/task/gotool#WithQuiet
[3]: https://pkg.go.dev/github.com/svengreb/wand@v0.8.0/pkg/task/golang#Runner
[4]: https://pkg.go.dev/github.com/svengreb/wand@v0.8.0/pkg/task/gotool#Runner
[5]: https://pkg.go.dev/github.com/svengreb/wand/pkg/task@v0.8.0#Runner.Run

[^1]: https://github.com/svengreb/wand/blob/v0.8.0/pkg/task/golang/golang.go#L43-L50
[^2]: https://github.com/svengreb/wand/blob/v0.8.0/pkg/task/gotool/gotool.go#L218-L225

GH-131
@svengreb svengreb added this to the version-next milestone Jul 9, 2023
@svengreb svengreb self-assigned this Jul 9, 2023
@svengreb svengreb merged commit 3fffd9e into main Jul 9, 2023
1 of 2 checks passed
@svengreb svengreb deleted the fix/gh-131-double-task-exec-with-quiet-runner-option branch July 9, 2023 09:25
@svengreb svengreb removed their assignment Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double task execution with quiet runner option
1 participant