diff --git a/gor_stat.go b/gor_stat.go index d7e14e4..205640e 100644 --- a/gor_stat.go +++ b/gor_stat.go @@ -2,9 +2,9 @@ package main import ( "log" + "runtime" "strconv" "time" - "runtime" ) const ( diff --git a/input_http.go b/input_http.go index d573d61..33263b9 100644 --- a/input_http.go +++ b/input_http.go @@ -45,9 +45,9 @@ func (i *HTTPInput) handler(w http.ResponseWriter, r *http.Request) { http.Error(w, http.StatusText(200), 200) select { - case i.data <- buf: - default: - Debug("[INPUT-HTTP] Dropping requests because output can't process them fast enough") + case i.data <- buf: + default: + Debug("[INPUT-HTTP] Dropping requests because output can't process them fast enough") } } diff --git a/input_http_test.go b/input_http_test.go index 3958ff7..6d1d64c 100644 --- a/input_http_test.go +++ b/input_http_test.go @@ -1,14 +1,14 @@ package main import ( + "github.com/buger/gor/proto" "io" + "log" "net/http" + "os/exec" "strings" "sync" "testing" - "os/exec" - "log" - "github.com/buger/gor/proto" ) func TestHTTPInput(t *testing.T) { @@ -37,7 +37,6 @@ func TestHTTPInput(t *testing.T) { close(quit) } - func TestInputHTTPLargePayload(t *testing.T) { wg := new(sync.WaitGroup) quit := make(chan int) diff --git a/middleware_test.go b/middleware_test.go index e96b42b..6589794 100644 --- a/middleware_test.go +++ b/middleware_test.go @@ -133,7 +133,7 @@ func TestEchoMiddleware(t *testing.T) { // Should receive 2 requests from original + 2 from replayed client := NewHTTPClient(from.URL, &HTTPClientConfig{Debug: false}) - for i:=0; i<10; i++ { + for i := 0; i < 10; i++ { wg.Add(4) // Request should be echoed client.Get("/a") diff --git a/raw_socket_listener/listener.go b/raw_socket_listener/listener.go index 8eb538b..e31088f 100644 --- a/raw_socket_listener/listener.go +++ b/raw_socket_listener/listener.go @@ -144,7 +144,7 @@ func (t *Listener) readRAWSocket() { newBuf := make([]byte, n) copy(newBuf, buf[:n]) - go func(newBuf []byte){ + go func(newBuf []byte) { t.packetsChan <- ParseTCPPacket(addr, newBuf) }(newBuf) } @@ -257,4 +257,4 @@ func (t *Listener) Close() { close(t.quit) t.conn.Close() return -} \ No newline at end of file +}