1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-11-25 22:21:49 +02:00
Files
fp-go/ioeither/generic/exec.go

17 lines
405 B
Go
Raw Normal View History

package generic
import (
"context"
ET "github.com/IBM/fp-go/either"
"github.com/IBM/fp-go/exec"
GE "github.com/IBM/fp-go/internal/exec"
)
// Command executes a command
func Command[GA ~func() ET.Either[error, exec.CommandOutput]](name string, args []string, in []byte) GA {
return TryCatchError[GA](func() (exec.CommandOutput, error) {
return GE.Exec(context.Background(), name, args, in)
})
}