From 25e47db4163505461ee51242d31342dcfe063405 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Fri, 18 Mar 2016 18:44:56 -0700 Subject: [PATCH] client: drop go1.4 tests --- client/cancelreq.go | 2 -- client/cancelreq_go14.go | 17 ------------- client/fake_transport_go14_test.go | 41 ------------------------------ client/fake_transport_test.go | 2 -- 4 files changed, 62 deletions(-) delete mode 100644 client/cancelreq_go14.go delete mode 100644 client/fake_transport_go14_test.go diff --git a/client/cancelreq.go b/client/cancelreq.go index fefdb40e4..76d1f0401 100644 --- a/client/cancelreq.go +++ b/client/cancelreq.go @@ -4,8 +4,6 @@ // borrowed from golang/net/context/ctxhttp/cancelreq.go -// +build go1.5 - package client import "net/http" diff --git a/client/cancelreq_go14.go b/client/cancelreq_go14.go deleted file mode 100644 index 2bed38a41..000000000 --- a/client/cancelreq_go14.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 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. - -// borrowed from golang/net/context/ctxhttp/cancelreq_go14.go - -// +build !go1.5 - -package client - -import "net/http" - -func requestCanceler(tr CancelableTransport, req *http.Request) func() { - return func() { - tr.CancelRequest(req) - } -} diff --git a/client/fake_transport_go14_test.go b/client/fake_transport_go14_test.go deleted file mode 100644 index 4a99a7d37..000000000 --- a/client/fake_transport_go14_test.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build !go1.5 - -package client - -import ( - "errors" - "net/http" -) - -func (t *fakeTransport) RoundTrip(req *http.Request) (*http.Response, error) { - select { - case resp := <-t.respchan: - return resp, nil - case err := <-t.errchan: - return nil, err - case <-t.startCancel: - select { - // this simulates that the request is finished before cancel effects - case resp := <-t.respchan: - return resp, nil - // wait on finishCancel to simulate taking some amount of - // time while calling CancelRequest - case <-t.finishCancel: - return nil, errors.New("cancelled") - } - } -} diff --git a/client/fake_transport_test.go b/client/fake_transport_test.go index 06761e266..7013a119f 100644 --- a/client/fake_transport_test.go +++ b/client/fake_transport_test.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build go1.5 - package client import (