Skip to content

Commit

Permalink
rename the Exec struct to OsExec in the pkg/execute/exec
Browse files Browse the repository at this point in the history
  • Loading branch information
apenella committed Aug 16, 2024
1 parent d5ea164 commit 98fc45d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/execute/defaultExecute.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (e *DefaultExecute) Execute(ctx context.Context) (err error) {
}

if e.Exec == nil {
e.Exec = exec.NewExec()
e.Exec = exec.NewOsExec()
}

if e.Cmd == nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/execute/defaultExecuteOptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestOptionsWithCmd(t *testing.T) {

// TestOptionsWithExecutable tests the function WithExecutable
func TestOptionsWithExecutable(t *testing.T) {
e := exec.NewExec()
e := exec.NewOsExec()

execute := NewDefaultExecute(
WithExecutable(e),
Expand Down
2 changes: 1 addition & 1 deletion pkg/execute/defaultExecute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func TestWithCmd(t *testing.T) {

// TestWithExecutable tests the function WithExecutable
func TestWithExecutable(t *testing.T) {
e := exec.NewExec()
e := exec.NewOsExec()

execute := NewDefaultExecute(
WithExecutable(e),
Expand Down
12 changes: 6 additions & 6 deletions pkg/execute/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import (
"os/exec"
)

// Exec struct wrapps the OS Exec package
type Exec struct{}
// OsExec struct wrapps the OS Exec package
type OsExec struct{}

func NewExec() *Exec {
return &Exec{}
func NewOsExec() *OsExec {
return &OsExec{}
}

// Command is a wrapper of exec.Command
func (e *Exec) Command(name string, arg ...string) Cmder {
func (e *OsExec) Command(name string, arg ...string) Cmder {
return exec.Command(name, arg...)
}

// CommandContext is a wrapper of exec.CommandContext
func (e *Exec) CommandContext(ctx context.Context, name string, arg ...string) Cmder {
func (e *OsExec) CommandContext(ctx context.Context, name string, arg ...string) Cmder {
return exec.CommandContext(ctx, name, arg...)
}

0 comments on commit 98fc45d

Please sign in to comment.