xesite/vendor/gopkg.in/segmentio/analytics-go.v3/timeout_15.go

17 lines
355 B
Go
Raw Normal View History

2018-08-22 03:17:59 +00:00
// +build !go1.6
package analytics
import "net/http"
// http clients on versions of go before 1.6 only support timeout if the
// transport implements the `CancelRequest` method.
func supportsTimeout(transport http.RoundTripper) bool {
_, ok := transport.(requestCanceler)
return ok
}
type requestCanceler interface {
CancelRequest(*http.Request)
}