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/text/template/exec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/text/template/exec.go') diff --git a/src/text/template/exec.go b/src/text/template/exec.go index efe1817173..5ea45a4c53 100644 --- a/src/text/template/exec.go +++ b/src/text/template/exec.go @@ -446,7 +446,7 @@ func (s *state) idealConstant(constant *parse.NumberNode) reflect.Value { switch { case constant.IsComplex: return reflect.ValueOf(constant.Complex128) // incontrovertible. - case constant.IsFloat && !isHexConstant(constant.Text) && strings.IndexAny(constant.Text, ".eE") >= 0: + case constant.IsFloat && !isHexConstant(constant.Text) && strings.ContainsAny(constant.Text, ".eE"): return reflect.ValueOf(constant.Float64) case constant.IsInt: n := int(constant.Int64) -- cgit v1.3-5-g9baa