aboutsummaryrefslogtreecommitdiffhomepage
path: root/helper/direct.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-15 01:02:18 +0900
committerOphestra <cat@gensokyo.uk>2025-03-15 01:06:31 +0900
commitf9bf20a3c75d01cf597477231f9bbb61f15cd4fd (patch)
tree702c804f7715b53888ab77b497d216a9cf673f2e /helper/direct.go
parent73c1a830320636f91a0d15d6d247e88650e81df1 (diff)
helper: rearrange initialisation args
This improves consistency across two different helper implementations. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'helper/direct.go')
-rw-r--r--helper/direct.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/helper/direct.go b/helper/direct.go
index 16aede83..74dd46ef 100644
--- a/helper/direct.go
+++ b/helper/direct.go
@@ -17,14 +17,14 @@ import (
// Function argF returns an array of arguments passed directly to the child process.
func NewDirect(
ctx context.Context,
- wt io.WriterTo,
name string,
+ wt io.WriterTo,
+ stat bool,
argF func(argsFd, statFd int) []string,
cmdF func(cmd *exec.Cmd),
- stat bool,
) Helper {
d := new(direct)
- d.helperCmd = newHelperCmd(ctx, name, wt, argF, nil, stat)
+ d.helperCmd = newHelperCmd(ctx, name, wt, argF, stat, nil)
if cmdF != nil {
cmdF(d.helperCmd.Cmd)
}
@@ -53,9 +53,12 @@ func (h *direct) Start() error {
}
func newHelperCmd(
- ctx context.Context, name string,
- wt io.WriterTo, argF func(argsFd, statFd int) []string,
- extraFiles []*os.File, stat bool,
+ ctx context.Context,
+ name string,
+ wt io.WriterTo,
+ argF func(argsFd, statFd int) []string,
+ stat bool,
+ extraFiles []*os.File,
) (cmd *helperCmd) {
cmd = new(helperCmd)
cmd.ctx = ctx