Skip to content

Commit d5a589a

Browse files
committed
replace io_discard by io.Discard
1 parent 234476d commit d5a589a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pkg/proxy/handler_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"crypto/sha256"
66
"encoding/hex"
77
"encoding/json"
8+
"io"
89
"log/slog"
910
"net/http"
1011
"net/http/httptest"
@@ -60,15 +61,10 @@ func newTestHandler(t *testing.T, upstream *httptest.Server, settled bool) (*Han
6061
PriceMsat: 10_000,
6162
ServiceName: "test",
6263
TokenTTL: 24 * time.Hour,
63-
}, backend, secret, slog.New(slog.NewTextHandler(io_discard{}, nil)))
64+
}, backend, secret, slog.New(slog.NewTextHandler(io.Discard, nil)))
6465
return h, tokens
6566
}
6667

67-
// io_discard is an io.Writer that discards all output (for silencing test logs).
68-
type io_discard struct{}
69-
70-
func (io_discard) Write(p []byte) (int, error) { return len(p), nil }
71-
7268
func TestServeHTTP_NoAuth_Returns402(t *testing.T) {
7369
upstream := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
7470
t.Error("upstream should not be called")

0 commit comments

Comments
 (0)