distribution/Godeps/_workspace/src/golang.org/x/net/context/ctxhttp/cancelreq.go
Arthur Baars 41e71e9a46 Google Cloud Storage (gcs) dependencies (2)
Add files of new dependencies to Godeps/_workspace

Signed-off-by: Arthur Baars <arthur@semmle.com>
2015-10-28 11:26:43 +00:00

18 lines
355 B
Go

// 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"
func canceler(client *http.Client, req *http.Request) func() {
ch := make(chan struct{})
req.Cancel = ch
return func() {
close(ch)
}
}