Skip to content

Commit

Permalink
lint: remove unused lockedBuf
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Feb 6, 2019
1 parent e28bceb commit 27af5e3
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions middleware_test.go
Expand Up @@ -7,7 +7,6 @@ import (
"net/http"
"net/http/httptest"
"os"
"sync"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 27af5e3

Please sign in to comment.