Documentation ¶
Index ¶
- Constants
- func EnsureProcessDone(p *os.Process) error
- func Errorf(format string, a ...interface{}) error
- func Fprintf(w io.Writer, format string, a ...interface{})
- func Interrupt(p *os.Process) error
- func IsExecutable(f os.FileInfo) bool
- func ProcessGroupAttr() *syscall.SysProcAttr
- func ReplacePathSeparator(input string) string
- func Sprintf(format string, a ...interface{}) string
Constants ¶
const ( // Exe is the runtime.GOOS-specific suffix for executables. Ex. "" unless windows which is ".exe" // See https://github.com/golang/go/issues/47567 for formalization Exe = exe // OSDarwin is a Platform.OS a.k.a. "macOS" OSDarwin = "darwin" // OSLinux is a Platform.OS OSLinux = "linux" // OSWindows is a Platform.OS OSWindows = "windows" )
Variables ¶
This section is empty.
Functions ¶
func EnsureProcessDone ¶ added in v0.7.0
EnsureProcessDone makes sure the process has exited completely.
func Errorf ¶ added in v0.7.0
Errorf is like fmt.Errorf except it translates paths with ReplacePathSeparator when Windows. This is needed because by default '\' escapes.
func Fprintf ¶ added in v0.7.0
Fprintf is like fmt.Fprintf, but handles EOL according runtime.GOOS. See Sprintf for notes.
func IsExecutable ¶
IsExecutable returns true if the input can be run as an exec.Cmd
func ProcessGroupAttr ¶
func ProcessGroupAttr() *syscall.SysProcAttr
ProcessGroupAttr sets attributes that ensure exec.Cmd doesn't propagate signals from func-e by default. This is used to ensure shutdown hooks can apply
func ReplacePathSeparator ¶ added in v0.7.0
ReplacePathSeparator returns the input unless it is Windows. When Windows, all '/' characters replace with '\'.
func Sprintf ¶ added in v0.7.0
Sprintf is like Fprintf is like fmt.Sprintf, except any '\n' in the format are converted according to runtime.GOOS. This allows us to be consistent with Envoy, which handles \r\n on Windows. See also https://github.com/golang/go/issues/28822
Types ¶
This section is empty.