From 617012c3fb701502f98ad9b7c27617a94560c581 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sat, 24 Sep 2016 21:27:57 -0600 Subject: [PATCH] Use time.Since() for readability --- caddyhttp/proxy/proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caddyhttp/proxy/proxy.go b/caddyhttp/proxy/proxy.go index 2613e750..fc2d727f 100644 --- a/caddyhttp/proxy/proxy.go +++ b/caddyhttp/proxy/proxy.go @@ -100,7 +100,7 @@ func (p Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) { start := time.Now() keepRetrying := func() bool { // if we've tried long enough, break - if time.Now().Sub(start) >= upstream.GetTryDuration() { + if time.Since(start) >= upstream.GetTryDuration() { return false } // otherwise, wait and try the next available host