File: compatibility_1_1.go

package info (click to toggle)
golang-github-ncw-swift 1.0.52-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 412 kB
  • sloc: python: 29; sh: 18; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 391 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Go 1.1 and later compatibility functions
//
// +build go1.1

package swift

import (
	"net/http"
	"time"
)

// Cancel the request
func cancelRequest(transport http.RoundTripper, req *http.Request) {
	if tr, ok := transport.(interface {
		CancelRequest(*http.Request)
	}); ok {
		tr.CancelRequest(req)
	}
}

// Reset a timer
func resetTimer(t *time.Timer, d time.Duration) {
	t.Reset(d)
}