From 1cb3044c9fcd88e1557eca1bf35845a4108bc1db Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Fri, 1 Apr 2016 03:49:43 +0200 Subject: all: use bytes.Equal, bytes.Contains and strings.Contains Change-Id: Iba82a5bd3846f7ab038cc10ec72ff6bcd2c0b484 Reviewed-on: https://go-review.googlesource.com/21377 Run-TryBot: Dave Cheney Reviewed-by: Dave Cheney --- src/encoding/xml/marshal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/encoding/xml') diff --git a/src/encoding/xml/marshal.go b/src/encoding/xml/marshal.go index ec4822b5c1..609c790520 100644 --- a/src/encoding/xml/marshal.go +++ b/src/encoding/xml/marshal.go @@ -856,7 +856,7 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { } case reflect.Slice: b := vf.Bytes() - dashDash = bytes.Index(b, ddBytes) >= 0 + dashDash = bytes.Contains(b, ddBytes) dashLast = b[len(b)-1] == '-' if !dashDash { p.Write(b) -- cgit v1.3