Skip to content

Commit

Permalink
apply option
Browse files Browse the repository at this point in the history
  • Loading branch information
darjun committed Nov 1, 2022
1 parent 9e8b765 commit d662032
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func CombinedOutput(cmd string, arg []string, opts ...Option) ([]byte, error) {
}

func CombinedOutputString(cmd string, arg []string, opts ...Option) (string, error) {
output, err := CombinedOutput(cmd, arg)
output, err := CombinedOutput(cmd, arg, opts...)
return string(output), err
}

Expand Down
12 changes: 12 additions & 0 deletions exec_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package goexec_test

import (
"fmt"
"testing"

"github.com/darjun/goexec"
)

func TestCombinedOutputString(t *testing.T) {
fmt.Println(goexec.CombinedOutputString("cal", nil, goexec.WithEnv("LANG", "en_US.UTF-8")))
}

0 comments on commit d662032

Please sign in to comment.