Commit fc492d2e authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

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: 's avatarTom Bergan <tombergan@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent e6a4aa30
// 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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment