From 27af5e3ba9439ec0df51c30794f473befe0a0e6d Mon Sep 17 00:00:00 2001 From: Umputun Date: Tue, 5 Feb 2019 18:34:51 -0600 Subject: [PATCH] lint: remove unused lockedBuf --- middleware_test.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/middleware_test.go b/middleware_test.go index 209a880..51fb6a9 100644 --- a/middleware_test.go +++ b/middleware_test.go @@ -7,7 +7,6 @@ import ( "net/http" "net/http/httptest" "os" - "sync" "testing" "github.com/stretchr/testify/assert" @@ -65,29 +64,6 @@ func TestMiddleware_Ping(t *testing.T) { assert.Equal(t, "blah blah", string(b)) } -type lockedBuf struct { - buf bytes.Buffer - lock sync.Mutex -} - -func (b *lockedBuf) Write(p []byte) (int, error) { - b.lock.Lock() - defer b.lock.Unlock() - return b.buf.Write(p) -} - -func (b *lockedBuf) Read(p []byte) (int, error) { - b.lock.Lock() - defer b.lock.Unlock() - return b.buf.Read(p) -} - -func (b *lockedBuf) String() string { - b.lock.Lock() - defer b.lock.Unlock() - return b.buf.String() -} - func TestMiddleware_Recoverer(t *testing.T) { handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {