aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/exec
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2011-06-28 09:43:14 +1000
committerRob Pike <r@golang.org>2011-06-28 09:43:14 +1000
commitebb1566a46f2f5b2c06ef0f7ad5f7084dce0aed9 (patch)
tree62c412f896baa504ae4a26d452f8cac6ce1aeed8 /src/pkg/exec
parent82a8afdf1411bbe5b08b09d1e94a8d1c4fb5635c (diff)
downloadgo-ebb1566a46f2f5b2c06ef0f7ad5f7084dce0aed9.tar.xz
strings.Split: make the default to split all.
Change the signature of Split to have no count, assuming a full split, and rename the existing Split with a count to SplitN. Do the same to package bytes. Add a gofix module. R=adg, dsymonds, alex.brainman, rsc CC=golang-dev https://golang.org/cl/4661051
Diffstat (limited to 'src/pkg/exec')
-rw-r--r--src/pkg/exec/exec_test.go2
-rw-r--r--src/pkg/exec/lp_plan9.go2
-rw-r--r--src/pkg/exec/lp_unix.go2
-rw-r--r--src/pkg/exec/lp_windows.go4
4 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/exec/exec_test.go b/src/pkg/exec/exec_test.go
index c45a7d70a6..f6cebb9055 100644
--- a/src/pkg/exec/exec_test.go
+++ b/src/pkg/exec/exec_test.go
@@ -55,7 +55,7 @@ func TestCatGoodAndBadFile(t *testing.T) {
t.Errorf("expected Waitmsg from cat combined; got %T: %v", err, err)
}
s := string(bs)
- sp := strings.Split(s, "\n", 2)
+ sp := strings.SplitN(s, "\n", 2)
if len(sp) != 2 {
t.Fatalf("expected two lines from cat; got %q", s)
}
diff --git a/src/pkg/exec/lp_plan9.go b/src/pkg/exec/lp_plan9.go
index c4e2a7a0f9..e4751a4df2 100644
--- a/src/pkg/exec/lp_plan9.go
+++ b/src/pkg/exec/lp_plan9.go
@@ -42,7 +42,7 @@ func LookPath(file string) (string, os.Error) {
}
path := os.Getenv("path")
- for _, dir := range strings.Split(path, "\000", -1) {
+ for _, dir := range strings.Split(path, "\000") {
if err := findExecutable(dir + "/" + file); err == nil {
return dir + "/" + file, nil
}
diff --git a/src/pkg/exec/lp_unix.go b/src/pkg/exec/lp_unix.go
index cdf7207688..008fb11a81 100644
--- a/src/pkg/exec/lp_unix.go
+++ b/src/pkg/exec/lp_unix.go
@@ -39,7 +39,7 @@ func LookPath(file string) (string, os.Error) {
return "", &Error{file, err}
}
pathenv := os.Getenv("PATH")
- for _, dir := range strings.Split(pathenv, ":", -1) {
+ for _, dir := range strings.Split(pathenv, ":") {
if dir == "" {
// Unix shell semantics: path element "" means "."
dir = "."
diff --git a/src/pkg/exec/lp_windows.go b/src/pkg/exec/lp_windows.go
index 47763458f8..7581088eb0 100644
--- a/src/pkg/exec/lp_windows.go
+++ b/src/pkg/exec/lp_windows.go
@@ -47,7 +47,7 @@ func LookPath(file string) (f string, err os.Error) {
x = `.COM;.EXE;.BAT;.CMD`
}
exts := []string{}
- for _, e := range strings.Split(strings.ToLower(x), `;`, -1) {
+ for _, e := range strings.Split(strings.ToLower(x), `;`) {
if e == "" {
continue
}
@@ -67,7 +67,7 @@ func LookPath(file string) (f string, err os.Error) {
return
}
} else {
- for _, dir := range strings.Split(pathenv, `;`, -1) {
+ for _, dir := range strings.Split(pathenv, `;`) {
if f, err = findExecutable(dir+`\`+file, exts); err == nil {
return
}