Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d579e1d

Browse files
chore: appease linter
1 parent a04548d commit d579e1d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

coderd/workspaceagents_internal_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ import (
1313
"strings"
1414
"testing"
1515

16+
"github.com/go-chi/chi/v5"
17+
"github.com/google/uuid"
18+
"github.com/stretchr/testify/require"
19+
"go.uber.org/mock/gomock"
20+
1621
"cdr.dev/slog"
1722
"cdr.dev/slog/sloggers/slogtest"
1823
"github.com/coder/coder/v2/coderd/database"
@@ -28,10 +33,6 @@ import (
2833
"github.com/coder/coder/v2/tailnet/tailnettest"
2934
"github.com/coder/coder/v2/testutil"
3035
"github.com/coder/websocket"
31-
"github.com/go-chi/chi/v5"
32-
"github.com/google/uuid"
33-
"github.com/stretchr/testify/require"
34-
"go.uber.org/mock/gomock"
3536
)
3637

3738
type fakeAgentProvider struct {
@@ -143,8 +144,11 @@ func TestWatchAgentContainers(t *testing.T) {
143144

144145
// And: Dial the WebSocket
145146
wsURL := strings.Replace(srv.URL, "http://", "ws://", 1)
146-
conn, _, err := websocket.Dial(ctx, fmt.Sprintf("%s/workspaceagents/%s/containers/watch", wsURL, agentID), nil)
147+
conn, resp, err := websocket.Dial(ctx, fmt.Sprintf("%s/workspaceagents/%s/containers/watch", wsURL, agentID), nil)
147148
require.NoError(t, err)
149+
if resp.Body != nil {
150+
defer resp.Body.Close()
151+
}
148152

149153
// And: Create a streaming decoder
150154
decoder := wsjson.NewDecoder[codersdk.WorkspaceAgentListContainersResponse](conn, websocket.MessageText, logger)

0 commit comments

Comments
 (0)