From f94dce37d6652d25e2339c1441b6d5dfa92bfb29 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 21 Mar 2017 15:06:01 -0700 Subject: [PATCH] main: Fix strings.Replace argument order It's (string, old, new, n), not (old, new, string, n) [1]. Fixes a typo I'd introduced in cdd7165 (main: Return to using TRAVIS_COMMIT_RANGE (with ... -> .. fix), 2017-03-21, #17). [1]: https://golang.org/pkg/strings/#Replace Signed-off-by: W. Trevor King --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 36d0f77..be5f1a8 100644 --- a/main.go +++ b/main.go @@ -51,7 +51,7 @@ func main() { if commitRange == "" { if strings.ToLower(os.Getenv("TRAVIS")) == "true" && !*flNoTravis { if os.Getenv("TRAVIS_COMMIT_RANGE") != "" { - commitRange = strings.Replace("...", "..", os.Getenv("TRAVIS_COMMIT_RANGE"), 1) + commitRange = strings.Replace(os.Getenv("TRAVIS_COMMIT_RANGE"), "...", "..", 1) } else if os.Getenv("TRAVIS_COMMIT") != "" { commitRange = os.Getenv("TRAVIS_COMMIT") }