From b04f3b06ec347543b0eafe82dcfb0e05885d3feb Mon Sep 17 00:00:00 2001 From: Nathan VanBenschoten Date: Tue, 22 Dec 2015 02:40:47 -0500 Subject: all: replace strings.Index with strings.Contains where possible Change-Id: Ia613f1c37bfce800ece0533a5326fca91d99a66a Reviewed-on: https://go-review.googlesource.com/18120 Reviewed-by: Robert Griesemer Run-TryBot: Robert Griesemer --- 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 8ebd693030..9fcd5d7695 100644 --- a/src/encoding/xml/marshal.go +++ b/src/encoding/xml/marshal.go @@ -850,7 +850,7 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { switch k { case reflect.String: s := vf.String() - dashDash = strings.Index(s, "--") >= 0 + dashDash = strings.Contains(s, "--") dashLast = s[len(s)-1] == '-' if !dashDash { p.WriteString(s) -- cgit v1.3