"os": {"L1", "os", "syscall", "time"},
"path/filepath": {"L2", "os", "syscall"},
"io/ioutil": {"L2", "os", "path/filepath", "time"},
- "os/exec": {"L2", "os", "syscall"},
+ "os/exec": {"L2", "os", "path/filepath", "syscall"},
"os/signal": {"L2", "os", "syscall"},
// OS enables basic operating system functionality,
"errors"
"io"
"os"
+ "path/filepath"
"strconv"
"sync"
"syscall"
Path: name,
Args: append([]string{name}, arg...),
}
- if !containsPathSeparator(name) {
+ if filepath.Base(name) == name {
if lp, err := LookPath(name); err != nil {
cmd.lookPathErr = err
} else {
return cmd
}
-func containsPathSeparator(s string) bool {
- for i := 0; i < len(s); i++ {
- if os.IsPathSeparator(s[i]) {
- return true
- }
- }
- return false
-}
-
// interfaceEqual protects against panics from doing equality tests on
// two interfaces with non-comparable underlying types.
func interfaceEqual(a, b interface{}) bool {