Ensure exec.Cmd.Path and exec.Cmd.Args[0] consistency
Open
Nobody has claimed this yet.
reliability
- Dominant language
- Go
- Stars
- 189
- Forks
- 24
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 18
Description
Create a factory function for exec.Cmd so that we do not have to do the following all over the codebase
cmd := exec.Command("docker", args...)
// exec.Command resolves cmd.Path via LookPath but leaves cmd.Args[0] as
// the original "docker" string. Align Args[0] with the resolved Path so
// downstream consumers and child-process
// argv[0] observers see a consistent, fully-qualified command name.
if cmd.Path != "" {
cmd.Args[0] = cmd.Path
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing exec.Command call sites and tracing how their Cmd values are consumed. Define the factory's scope from those uses, then verify that commands created through it have Args[0] aligned with the resolved Path and that all relevant call sites use the factory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100