reexec: align closer to exec.Command#191
Merged
Conversation
90223b1 to
e7eb7e4
Compare
e7eb7e4 to
e7a5b32
Compare
e7a5b32 to
8ff6205
Compare
Make our implementation a wrapper for exec.Command to make sure our implementation keeps aligned with a regular exec.Command with the exception of the "Args" that we need to override, and (on Linux), Pdeathsig to be set. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
8ff6205 to
d05b721
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors our reexec package to more closely align with the behavior of exec.Command by wrapping it while still overriding Args and, on Linux, setting Pdeathsig.
- Updated test cases in reexec_test.go to validate the new command API and output formatting.
- Modified command implementations in reexec_other.go and reexec_linux.go to use exec.Command and adjust the Args field accordingly.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| reexec/reexec_test.go | Updated testing to check the new command signature and output format. |
| reexec/reexec_other.go | Refactored command creation to call exec.Command and remove the prepended Self(). |
| reexec/reexec_linux.go | Same as above with additional setting of Pdeathsig for Linux. |
Comments suppressed due to low confidence (1)
reexec/reexec_test.go:23
- The new code uses fmt functions (e.g. fmt.Sprintf and fmt.Println) but the 'fmt' package is not imported. Please add 'import "fmt"' to the import block.
var args string
vvoland
approved these changes
Jun 24, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Make our implementation a wrapper for exec.Command to make sure our implementation keeps aligned with a regular exec.Command with the exception of the "Args" that we need to override, and (on Linux), Pdeathsig to be set.