Skip to content

Commit b69dd02

Browse files
committed
lint
1 parent e7ececa commit b69dd02

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

codersdk/client.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,13 @@ func (c *Client) Request(ctx context.Context, method, path string, body interfac
8686
func (c *Client) websocket(ctx context.Context, path string) (*websocket.Conn, error) {
8787
serverURL, err := c.URL.Parse(path)
8888
if err != nil {
89-
return nil, xerrors.Errorf("parse url: %w", err)
89+
return nil, xerrors.Errorf("parse path: %w", err)
9090
}
9191

9292
apiURL, err := url.Parse(serverURL.String())
93+
if err != nil {
94+
return nil, xerrors.Errorf("parse server url: %w", err)
95+
}
9396
apiURL.Scheme = "ws"
9497
if serverURL.Scheme == "https" {
9598
apiURL.Scheme = "wss"
@@ -100,7 +103,7 @@ func (c *Client) websocket(ctx context.Context, path string) (*websocket.Conn, e
100103
apiURL.RawQuery = q.Encode()
101104

102105
//nolint:bodyclose
103-
conn, _, err := websocket.Dial(context.Background(), apiURL.String(), &websocket.DialOptions{
106+
conn, _, err := websocket.Dial(ctx, apiURL.String(), &websocket.DialOptions{
104107
HTTPClient: c.HTTPClient,
105108
})
106109
if err != nil {

codersdk/workspaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (w *WorkspaceWatcher) Read(ctx context.Context) (Workspace, error) {
102102
var ws Workspace
103103
err := wsjson.Read(ctx, w.conn, &ws)
104104
if err != nil {
105-
return ws, xerrors.Errorf("read workspace: %w")
105+
return ws, xerrors.Errorf("read workspace: %w", err)
106106
}
107107

108108
return ws, nil

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy