Skip to content

Commit 697b028

Browse files
authored
chore: fix low hanging lint issues (#9253)
1 parent 306615c commit 697b028

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

coderd/httpmw/workspaceagent_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ func TestWorkspaceAgent(t *testing.T) {
5252
req.Header.Set(codersdk.SessionTokenHeader, authToken.String())
5353
rtr.ServeHTTP(rw, req)
5454

55+
//nolint:bodyclose // Closed in `t.Cleanup`
5556
res := rw.Result()
5657
t.Cleanup(func() { _ = res.Body.Close() })
5758
require.Equal(t, http.StatusOK, res.StatusCode)

coderd/oauthpki/oidcpki.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"encoding/base64"
99
"encoding/json"
1010
"encoding/pem"
11-
"fmt"
1211
"io"
1312
"net/http"
1413
"net/url"
@@ -243,7 +242,7 @@ func (src *jwtTokenSource) Token() (*oauth2.Token, error) {
243242
}
244243

245244
if unmarshalError != nil {
246-
return nil, fmt.Errorf("oauth2: cannot unmarshal token: %w", err)
245+
return nil, xerrors.Errorf("oauth2: cannot unmarshal token: %w", err)
247246
}
248247

249248
newToken := &oauth2.Token{
@@ -264,7 +263,7 @@ func (src *jwtTokenSource) Token() (*oauth2.Token, error) {
264263
// decode returned id token to get expiry
265264
claimSet, err := jws.Decode(v)
266265
if err != nil {
267-
return nil, fmt.Errorf("oauth2: error decoding JWT token: %w", err)
266+
return nil, xerrors.Errorf("oauth2: error decoding JWT token: %w", err)
268267
}
269268
newToken.Expiry = time.Unix(claimSet.Exp, 0)
270269
}

enterprise/coderd/coderd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ func (api *API) runEntitlementsLoop(ctx context.Context) {
807807
subscribed := false
808808

809809
defer func() {
810-
// If this function ends, it means the context was cancelled and this
810+
// If this function ends, it means the context was canceled and this
811811
// coderd is shutting down. In this case, post a pubsub message to
812812
// tell other coderd's to resync their entitlements. This is required to
813813
// make sure things like replica counts are updated in the UI.

0 commit comments

Comments
 (0)