From 406d2fa2f3034974e94620bacf6c09bcabaf85fd Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Mon, 28 Nov 2016 20:31:18 -0500 Subject: [PATCH] net/http: fix test TestServeMuxHandlerRedirects The code was intended to test that mux handler should redirect at most once, but the added loop condition defeated that. Remove the loop condition and document the intention better. Fixes #18068. Change-Id: I2a4ea041eae27168b45a09aa46e740ac03921594 Reviewed-on: https://go-review.googlesource.com/33654 TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick --- src/net/http/serve_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index 01a289fe97..593b1f3cdd 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -400,9 +400,9 @@ func TestServeMuxHandlerRedirects(t *testing.T) { } for _, tt := range serveMuxTests2 { - tries := 1 + tries := 1 // expect at most 1 redirection if redirOk is true. turl := tt.url - for tries > 0 { + for { u, e := url.Parse(turl) if e != nil { t.Fatal(e) -- 2.50.0