mirror of
https://github.com/golang/net.git
synced 2026-03-31 18:37:08 +09:00
http/httpproxy: fix build on Go 1.8
Go 1.8 doesn't have t.Helper. Fix the row of red on the dashboard. Change-Id: I85d4bb9fe38e989dc3b6a4e99705599745b83cef Reviewed-on: https://go-review.googlesource.com/80140 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Tom Bergan <tombergan@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
13
http/httpproxy/go19_test.go
Normal file
13
http/httpproxy/go19_test.go
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build go1.9
|
||||
|
||||
package httpproxy_test
|
||||
|
||||
import "testing"
|
||||
|
||||
func init() {
|
||||
setHelper = func(t *testing.T) { t.Helper() }
|
||||
}
|
||||
@@ -16,6 +16,9 @@ import (
|
||||
"golang.org/x/net/http/httpproxy"
|
||||
)
|
||||
|
||||
// setHelper calls t.Helper() for Go 1.9+ (see go19_test.go) and does nothing otherwise.
|
||||
var setHelper = func(t *testing.T) {}
|
||||
|
||||
type proxyForURLTest struct {
|
||||
cfg httpproxy.Config
|
||||
req string // URL to fetch; blank means "http://example.com"
|
||||
@@ -166,7 +169,7 @@ var proxyForURLTests = []proxyForURLTest{{
|
||||
}}
|
||||
|
||||
func testProxyForURL(t *testing.T, tt proxyForURLTest) {
|
||||
t.Helper()
|
||||
setHelper(t)
|
||||
reqURLStr := tt.req
|
||||
if reqURLStr == "" {
|
||||
reqURLStr = "http://example.com"
|
||||
|
||||
Reference in New Issue
Block a user