Skip to content

Commit

Permalink
remove wrapper
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Scherba <[email protected]>
  • Loading branch information
miklezzzz committed Feb 5, 2025
1 parent 411cb79 commit e93862d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 0 additions & 12 deletions pkg/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ func (e *Executor) WithLogger(logger *log.Logger) *Executor {
return e
}

func (e *Executor) WithWrapper(path string) *Executor {
if len(path) > 0 {
e.cmd.Path = path

newArgs := make([]string, 1, len(e.cmd.Args)+1)
newArgs[0] = path
e.cmd.Args = append(newArgs, e.cmd.Args...)
}

return e
}

func (e *Executor) WithChroot(path string) *Executor {
if len(path) > 0 {
e.cmd.SysProcAttr = &syscall.SysProcAttr{
Expand Down
4 changes: 2 additions & 2 deletions pkg/executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ func TestRunAndLogLines(t *testing.T) {
_, err := ex.RunAndLogLines(map[string]string{"a": "b"})
assert.NoError(t, err)

assert.Equal(t, buf.String(), `{"level":"debug","msg":"json log line not map[string]interface{}","source":"executor/executor.go:201","a":"b","line":["a","b","c"],"output":"stdout","time":"2006-01-02T15:04:05Z"}`+"\n"+
`{"level":"info","msg":"[\"a\",\"b\",\"c\"]\n","source":"executor/executor.go:204","a":"b","output":"stdout","time":"2006-01-02T15:04:05Z"}`+"\n")
assert.Equal(t, buf.String(), `{"level":"debug","msg":"json log line not map[string]interface{}","source":"executor/executor.go:189","a":"b","line":["a","b","c"],"output":"stdout","time":"2006-01-02T15:04:05Z"}`+"\n"+
`{"level":"info","msg":"[\"a\",\"b\",\"c\"]\n","source":"executor/executor.go:192","a":"b","output":"stdout","time":"2006-01-02T15:04:05Z"}`+"\n")
buf.Reset()
})

Expand Down

0 comments on commit e93862d

Please sign in to comment.