diff options
| author | apocelipes <seve3r@outlook.com> | 2025-02-05 00:37:18 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-02-04 17:20:47 -0800 |
| commit | a1ea78c470d3136b7aed42a4d8b94497563f98ea (patch) | |
| tree | eeff0948e18d8ac6087b9120f0be65ab64fd13af /src/net/http/httputil/reverseproxy_test.go | |
| parent | 0e35fb2f99ce4c249c0a42ad93a597835ae742b5 (diff) | |
| download | go-a1ea78c470d3136b7aed42a4d8b94497563f98ea.tar.xz | |
net: use strings.SplitSeq and bytes.SplitSeq
Replace `for _, s := range {strings, bytes}.Split(v, sep)` with
`for s := range {strings, bytes}.SplitSeq(v, sep)`, to simplify
the code and reduce some memory allocations.
Change-Id: Idead4de1e3928fc75cc5ba8caeff85542f1243d5
GitHub-Last-Rev: 5fb196a073e7583b23b1ebb446d6c067580ed63a
GitHub-Pull-Request: golang/go#71554
Reviewed-on: https://go-review.googlesource.com/c/go/+/646216
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/net/http/httputil/reverseproxy_test.go')
| -rw-r--r-- | src/net/http/httputil/reverseproxy_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go index 2f9a5eec5c..c618f6f19e 100644 --- a/src/net/http/httputil/reverseproxy_test.go +++ b/src/net/http/httputil/reverseproxy_test.go @@ -197,7 +197,7 @@ func TestReverseProxyStripHeadersPresentInConnection(t *testing.T) { c := r.Header["Connection"] var cf []string for _, f := range c { - for _, sf := range strings.Split(f, ",") { + for sf := range strings.SplitSeq(f, ",") { if sf = strings.TrimSpace(sf); sf != "" { cf = append(cf, sf) } |
