From 043c0b743655fee427d64f513cec0450a74c94d0 Mon Sep 17 00:00:00 2001 From: Leonid Bugaev Date: Mon, 23 Jan 2017 13:33:36 +0300 Subject: [PATCH] few fmt fixes --- emitter.go | 8 ++++---- http_client.go | 4 ++-- test_input.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/emitter.go b/emitter.go index 5741345..ca5bb83 100644 --- a/emitter.go +++ b/emitter.go @@ -88,7 +88,7 @@ func CopyMulty(src io.Reader, writers ...io.Writer) (err error) { } } else { if _, ok := filteredRequests[requestID]; ok { - delete(filteredRequests, requestID); + delete(filteredRequests, requestID) continue } } @@ -119,12 +119,12 @@ func CopyMulty(src io.Reader, writers ...io.Writer) (err error) { } // Run GC on each 1000 request - if i % 1000 == 0 { + if i%1000 == 0 { // Clean up filtered requests for which we didn't get a response to filter now := time.Now() - if now.Sub(filteredRequestsLastCleanTime) > 60 * time.Second { + if now.Sub(filteredRequestsLastCleanTime) > 60*time.Second { for k, v := range filteredRequests { - if now.Sub(v) > 60 * time.Second { + if now.Sub(v) > 60*time.Second { delete(filteredRequests, k) } } diff --git a/http_client.go b/http_client.go index aeb322f..f78a819 100644 --- a/http_client.go +++ b/http_client.go @@ -61,7 +61,7 @@ func NewHTTPClient(baseURL string, config *HTTPClientConfig) *HTTPClient { if config.Timeout == 0 { config.Timeout = time.Second - } + } config.ConnectionTimeout = config.Timeout @@ -87,7 +87,7 @@ func (c *HTTPClient) Connect() (err error) { c.Disconnect() if !strings.Contains(c.host, ":") { - c.conn, err = net.DialTimeout("tcp", c.host + ":" + defaultPorts[c.scheme], c.config.ConnectionTimeout) + c.conn, err = net.DialTimeout("tcp", c.host+":"+defaultPorts[c.scheme], c.config.ConnectionTimeout) } else { c.conn, err = net.DialTimeout("tcp", c.host, c.config.ConnectionTimeout) } diff --git a/test_input.go b/test_input.go index a69debf..0c6a2f7 100644 --- a/test_input.go +++ b/test_input.go @@ -8,7 +8,7 @@ import ( // TestInput used for testing purpose, it allows emitting requests on demand type TestInput struct { - data chan []byte + data chan []byte skipHeader bool }