Source File
execabs.go
Belonging Package
internal/execabs
package execabs
import (
)
var ErrNotFound = exec.ErrNotFound
type (
Cmd = exec.Cmd
Error = exec.Error
ExitError = exec.ExitError
)
func (, string) error {
return fmt.Errorf("%s resolves to executable relative to current directory (.%c%s)", , filepath.Separator, )
}
func ( string) (string, error) {
, := exec.LookPath()
if != nil {
return "",
}
if filepath.Base() == && !filepath.IsAbs() {
return "", relError(, )
}
return , nil
}
func ( string, *exec.Cmd) {
:= (*error)(unsafe.Pointer(reflect.ValueOf().Elem().FieldByName("lookPathErr").Addr().Pointer()))
if * == nil {
* = relError(, .Path)
}
.Path = ""
}
}
func ( context.Context, string, ...string) *exec.Cmd {
:= exec.CommandContext(, , ...)
fixCmd(, )
return
}
func ( string, ...string) *exec.Cmd {
:= exec.Command(, ...)
fixCmd(, )
return
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |