cancelreq_go14.go 395 B

1234567891011121314151617
  1. // Copyright 2015 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // borrowed from golang/net/context/ctxhttp/cancelreq_go14.go
  5. // +build !go1.5
  6. package client
  7. import "net/http"
  8. func requestCanceler(tr CancelableTransport, req *http.Request) func() {
  9. return func() {
  10. tr.CancelRequest(req)
  11. }
  12. }