aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/internal/http2/errors.go
diff options
context:
space:
mode:
authorqiulaidongfeng <2645477756@qq.com>2026-03-13 23:43:05 +0800
committerNicholas Husin <nsh@golang.org>2026-03-23 12:27:43 -0700
commite1bc5cea825171f68f928686ed02a0d0abddd84c (patch)
treed3c98995c7dd19f19a2cb982170d28a9262007cd /src/net/http/internal/http2/errors.go
parent224489f11c2e0b394e93980fc8292c52f60b18a8 (diff)
downloadgo-e1bc5cea825171f68f928686ed02a0d0abddd84c.tar.xz
net/http/internal/http2: modernize the package
This CL is mostly generated by running go fix. Manual edits have also been selectively done to modernize the package where doing so is straightforward; for example, using slices.Contains in lieu of strSliceContains. Change-Id: Ie2942481672c56c370e2df0f172cf3e480a12bc5 Reviewed-on: https://go-review.googlesource.com/c/go/+/757220 Reviewed-by: Nicholas Husin <husin@google.com> Reviewed-by: Nicholas Husin <nsh@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/net/http/internal/http2/errors.go')
-rw-r--r--src/net/http/internal/http2/errors.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/http/internal/http2/errors.go b/src/net/http/internal/http2/errors.go
index 35c34b7ba5..58822972bc 100644
--- a/src/net/http/internal/http2/errors.go
+++ b/src/net/http/internal/http2/errors.go
@@ -104,14 +104,14 @@ func (e StreamError) As(target any) bool {
if dstType.NumField() != numField {
return false
}
- for i := 0; i < numField; i++ {
+ for i := range numField {
sf := srcType.Field(i)
df := dstType.Field(i)
if sf.Name != df.Name || !sf.Type.ConvertibleTo(df.Type) {
return false
}
}
- for i := 0; i < numField; i++ {
+ for i := range numField {
df := dst.Field(i)
df.Set(src.Field(i).Convert(df.Type()))
}