mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
strings: Contains
Tiny helper to avoid strings.Index(s, sub) != -1 R=rsc, r2, r CC=golang-dev https://golang.org/cl/2265044
This commit is contained in:
parent
e8436689ad
commit
e198a5086a
11 changed files with 38 additions and 12 deletions
|
|
@ -25,7 +25,7 @@ func LookPath(file string) (string, os.Error) {
|
|||
// (only bypass the path if file begins with / or ./ or ../)
|
||||
// but that would not match all the Unix shells.
|
||||
|
||||
if strings.Index(file, "/") >= 0 {
|
||||
if strings.Contains(file, "/") {
|
||||
if canExec(file) {
|
||||
return file, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue