]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blame - vendor/github.com/fsouza/go-dockerclient/cancelable.go
provider: Ensured Go 1.11 in TravisCI and README
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / fsouza / go-dockerclient / cancelable.go
CommitLineData
9b12e4fe
JC
1// Copyright 2016 go-dockerclient 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
5// +build go1.5
6
7package docker
8
9import "net/http"
10
11func cancelable(client *http.Client, req *http.Request) func() {
12 ch := make(chan struct{})
13 req.Cancel = ch
14 return func() {
15 close(ch)
16 }
17}