From b019f3ee29ce55c3d515ee8bafe0f4bb14221c0a Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Thu, 11 Feb 2016 16:16:52 +0200 Subject: Godeps: update all dependencies to latest code --- .../x/net/context/ctxhttp/cancelreq_go14.go | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go (limited to 'Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go') diff --git a/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go b/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go new file mode 100644 index 000000000..56bcbadb8 --- /dev/null +++ b/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq_go14.go @@ -0,0 +1,23 @@ +// 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. + +// +build !go1.5 + +package ctxhttp + +import "net/http" + +type requestCanceler interface { + CancelRequest(*http.Request) +} + +func canceler(client *http.Client, req *http.Request) func() { + rc, ok := client.Transport.(requestCanceler) + if !ok { + return func() {} + } + return func() { + rc.CancelRequest(req) + } +} -- cgit