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
Dr. Carsten Leue b25de3c7c3 doc: fix case
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
2023-07-18 15:57:54 +02:00

17 lines
405 B
Go

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)
})
}