1
0
Fork 0
mirror of https://github.com/vbatts/git-validation.git synced 2024-11-26 01:55:40 +00:00

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 <wking@tremily.us>
This commit is contained in:
W. Trevor King 2017-03-21 15:06:01 -07:00
parent 4cee76b1df
commit f94dce37d6

View file

@ -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")
}