aboutsummaryrefslogtreecommitdiff
path: root/src/html/template
diff options
context:
space:
mode:
authorDominik Honnef <dominik@honnef.co>2016-04-01 03:49:43 +0200
committerDave Cheney <dave@cheney.net>2016-04-01 02:05:01 +0000
commit1cb3044c9fcd88e1557eca1bf35845a4108bc1db (patch)
tree0ab6a665c480df7fa978af784cb2bb702acdc27f /src/html/template
parent42d62946946eb0e6dc55fe76973c84eafd113154 (diff)
downloadgo-1cb3044c9fcd88e1557eca1bf35845a4108bc1db.tar.xz
all: use bytes.Equal, bytes.Contains and strings.Contains
Change-Id: Iba82a5bd3846f7ab038cc10ec72ff6bcd2c0b484 Reviewed-on: https://go-review.googlesource.com/21377 Run-TryBot: Dave Cheney <dave@cheney.net> Reviewed-by: Dave Cheney <dave@cheney.net>
Diffstat (limited to 'src/html/template')
-rw-r--r--src/html/template/css.go2
-rw-r--r--src/html/template/escape_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/html/template/css.go b/src/html/template/css.go
index 318464835f..4c27cce85a 100644
--- a/src/html/template/css.go
+++ b/src/html/template/css.go
@@ -249,7 +249,7 @@ func cssValueFilter(args ...interface{}) string {
}
}
id = bytes.ToLower(id)
- if bytes.Index(id, expressionBytes) != -1 || bytes.Index(id, mozBindingBytes) != -1 {
+ if bytes.Contains(id, expressionBytes) || bytes.Contains(id, mozBindingBytes) {
return filterFailsafe
}
return string(b)
diff --git a/src/html/template/escape_test.go b/src/html/template/escape_test.go
index 707394e3b0..023ee57d59 100644
--- a/src/html/template/escape_test.go
+++ b/src/html/template/escape_test.go
@@ -990,7 +990,7 @@ func TestErrors(t *testing.T) {
}
continue
}
- if strings.Index(got, test.err) == -1 {
+ if !strings.Contains(got, test.err) {
t.Errorf("input=%q: error\n\t%q\ndoes not contain expected string\n\t%q", test.input, got, test.err)
continue
}