From ac4843b4601f95380c831532cf9152a827de953b Mon Sep 17 00:00:00 2001 From: Markus Linnala Date: Sun, 20 Oct 2019 17:24:02 +0300 Subject: [PATCH] cleanup: xtransport: group all consts and alike This is mainly for case where more consts are added. Also I think those vars were not variables but treated as const. --- dnscrypt-proxy/xtransport.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dnscrypt-proxy/xtransport.go b/dnscrypt-proxy/xtransport.go index a43428f3..d3b9efd7 100644 --- a/dnscrypt-proxy/xtransport.go +++ b/dnscrypt-proxy/xtransport.go @@ -25,7 +25,11 @@ import ( netproxy "golang.org/x/net/proxy" ) -const DefaultFallbackResolver = "9.9.9.9:53" +const ( + DefaultFallbackResolver = "9.9.9.9:53" + DefaultKeepAlive = 5 * time.Second + DefaultTimeout = 30 * time.Second +) type CachedIPs struct { sync.RWMutex @@ -48,9 +52,6 @@ type XTransport struct { httpProxyFunction func(*http.Request) (*url.URL, error) } -var DefaultKeepAlive = 5 * time.Second -var DefaultTimeout = 30 * time.Second - func NewXTransport() *XTransport { xTransport := XTransport{ cachedIPs: CachedIPs{cache: make(map[string]string)},