From 4cb798f123fda3d3e33449475a42af905153cb07 Mon Sep 17 00:00:00 2001 From: zihengCat Date: Fri, 25 Jun 2021 15:49:35 +0800 Subject: [PATCH] use for-loop instead of range --- binding/default_validator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binding/default_validator.go b/binding/default_validator.go index 45f010c7e2..fbc6fc3dae 100644 --- a/binding/default_validator.go +++ b/binding/default_validator.go @@ -32,8 +32,8 @@ func (err sliceValidateError) Error() string { b.WriteString(fmt.Sprintf("[%d]: %s", 0, err[0].Error())) } if n > 1 { - for i, e := range err[1:] { - if e != nil { + for i := 1; i < n; i++ { + if err[i] != nil { b.WriteString("\n") b.WriteString(fmt.Sprintf("[%d]: %s", i, err[i].Error())) }