Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit ef54744

Browse files
committed
Rename AroundRoundTrip => Around
1 parent ff2042c commit ef54744

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎httpcache.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ type Transport struct {
105105
// If true, responses returned from the cache will be given an extra header, X-From-Cache
106106
MarkCachedResponses bool
107107

108-
// AroundRoundTrip is an optional func.
109-
// If set, the Transport will call AroundRoundTrip at the start of RoundTrip
108+
// Around is an optional func.
109+
// If set, the Transport will call Around at the start of RoundTrip
110110
// and defer the returned func until the end of RoundTrip.
111111
// Typically used to implement a lock that is held for the duration of the RoundTrip.
112-
AroundRoundTrip func(key string) func()
112+
Around func(key string) func()
113113
}
114114

115115
// varyMatches will return false unless all of the cached values for the headers listed in Vary
@@ -134,7 +134,7 @@ func varyMatches(cachedResp *http.Response, req *http.Request) bool {
134134
// will be returned.
135135
func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error) {
136136
cacheKey := cacheKey(req)
137-
if f := t.AroundRoundTrip; f != nil {
137+
if f := t.Around; f != nil {
138138
defer f(cacheKey)()
139139
}
140140
cacheable := (req.Method == "GET" || req.Method == "HEAD") && req.Header.Get("range") == ""

0 commit comments

Comments
 (0)