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

Skip to content

Commit b146424

Browse files
committed
fix lint
1 parent 9c74018 commit b146424

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

coderd/workspaces.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"net/http"
1010
"time"
1111

12-
"cdr.dev/slog"
1312
"github.com/go-chi/chi/v5"
1413
"github.com/google/uuid"
1514
"github.com/moby/moby/pkg/namesgenerator"
@@ -18,6 +17,8 @@ import (
1817
"nhooyr.io/websocket"
1918
"nhooyr.io/websocket/wsjson"
2019

20+
"cdr.dev/slog"
21+
2122
"github.com/coder/coder/coderd/autobuild/schedule"
2223
"github.com/coder/coder/coderd/database"
2324
"github.com/coder/coder/coderd/httpapi"

codersdk/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ func (c *Client) Request(ctx context.Context, method, path string, body interfac
8181
return resp, err
8282
}
8383

84-
// websocket opens a websocket connection on that path provided.
85-
// The caller is responsible for closing the websocket.Conn.
86-
func (c *Client) websocket(ctx context.Context, path string) (*websocket.Conn, error) {
84+
// dialWebsocket opens a dialWebsocket connection on that path provided.
85+
// The caller is responsible for closing the dialWebsocket.Conn.
86+
func (c *Client) dialWebsocket(ctx context.Context, path string) (*websocket.Conn, error) {
8787
serverURL, err := c.URL.Parse(path)
8888
if err != nil {
8989
return nil, xerrors.Errorf("parse path: %w", err)

codersdk/workspaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (w *WorkspaceWatcher) Close() error {
118118
}
119119

120120
func (c *Client) WatchWorkspace(ctx context.Context, id uuid.UUID) (*WorkspaceWatcher, error) {
121-
conn, err := c.websocket(ctx, fmt.Sprintf("/api/v2/workspaces/%s/watch", id))
121+
conn, err := c.dialWebsocket(ctx, fmt.Sprintf("/api/v2/workspaces/%s/watch", id))
122122
if err != nil {
123123
return nil, err
124124
}

0 commit comments

Comments
 (0)