making linter happy

Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
This commit is contained in:
Dmitri Dolguikh
2026-09-10 12:44:37 +02:00
parent eadb0f11bf
commit c62f9ba0dc
+10 -9
View File
@@ -58,12 +58,13 @@ func TestAdapterHandlingConnectionClosures(t *testing.T) {
go httpServer.Serve(l) //nolint:errcheck go httpServer.Serve(l) //nolint:errcheck
t.Cleanup(func() { httpServer.Close() }) t.Cleanup(func() { httpServer.Close() })
clientconn, _, err := websocket.Dial(context.Background(), "http://whatever", &websocket.DialOptions{HTTPClient: &http.Client{ clientconn, _, err := websocket.Dial(context.Background(), "http://whatever",
Transport: &http.Transport{ &websocket.DialOptions{HTTPClient: &http.Client{
DialContext: func(_ context.Context, _, _ string) (net.Conn, error) { Transport: &http.Transport{
return net.Dial("unix", serversock) DialContext: func(_ context.Context, _, _ string) (net.Conn, error) {
}, return net.Dial("unix", serversock)
}}}) },
}}})
assert.NoError(t, err) assert.NoError(t, err)
clientCtx, cancel := context.WithCancel(context.Background()) //nolint:govet clientCtx, cancel := context.WithCancel(context.Background()) //nolint:govet
@@ -83,7 +84,7 @@ func TestAdapterHandlingConnectionClosures(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
body, err := io.ReadAll(resp.Body) body, err := io.ReadAll(resp.Body)
t.Cleanup(func() { resp.Body.Close() }) defer resp.Body.Close()
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, "echo: g'day", string(body)) assert.Equal(t, "echo: g'day", string(body))
@@ -118,8 +119,8 @@ func TestAdapterHandlingHttpConnection_NoHeadersSent(t *testing.T) {
proxy := New(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { proxy := New(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
buf, _ := io.ReadAll(r.Body) buf, _ := io.ReadAll(r.Body)
defer r.Body.Close() //nolint:errcheck defer r.Body.Close() //nolint:errcheck
w.Write([]byte("echo: " + string(buf))) w.Write([]byte("echo: " + string(buf))) //nolint:errcheck
})) }))
handler, ok := proxy.Handler().(*proxyHandler) handler, ok := proxy.Handler().(*proxyHandler)