refactor: internal package

This commit is contained in:
Anton
2023-12-04 23:40:41 +05:00
parent 05654bd6fa
commit ad79565a93
51 changed files with 39 additions and 39 deletions

31
internal/execy/execy.go Normal file
View File

@@ -0,0 +1,31 @@
// Package execy runs external commands.
package execy
import (
"os/exec"
)
var runner = Runner(&osRunner{})
// Runner executes external commands.
type Runner interface {
Run(cmd *exec.Cmd) error
}
// osRunner runs OS programs.
type osRunner struct{}
func (r *osRunner) Run(cmd *exec.Cmd) error {
return cmd.Run()
}
func Run(cmd *exec.Cmd) error {
return runner.Run(cmd)
}
// CmdOut represents the result of the command run.
type CmdOut struct {
Stdout string
Stderr string
Err error
}