diff --git a/context_test.go b/context_test.go index 6c092d374d..c643dd5212 100644 --- a/context_test.go +++ b/context_test.go @@ -13,6 +13,8 @@ import ( "net/http" "net/http/httptest" "reflect" + "runtime" + "strconv" "strings" "testing" "time" @@ -1389,6 +1391,12 @@ func (i interceptedWriter) WriteHeader(code int) { } func TestInterceptedHeader(t *testing.T) { + if strings.HasPrefix(runtime.Version(), "go1.") { + v, err := strconv.Atoi(strings.SplitAfterN(runtime.Version(), ".", 2)[1]) + if err != nil || v < 7 { + t.Skipf("This test is relying on httptest.ResponseRecorder.Result not implementein version %s", runtime.Version()) + } + } w := httptest.NewRecorder() c, r := CreateTestContext(w)