mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: fix low hanging lint issues (#9253)
This commit is contained in:
@ -52,6 +52,7 @@ func TestWorkspaceAgent(t *testing.T) {
|
|||||||
req.Header.Set(codersdk.SessionTokenHeader, authToken.String())
|
req.Header.Set(codersdk.SessionTokenHeader, authToken.String())
|
||||||
rtr.ServeHTTP(rw, req)
|
rtr.ServeHTTP(rw, req)
|
||||||
|
|
||||||
|
//nolint:bodyclose // Closed in `t.Cleanup`
|
||||||
res := rw.Result()
|
res := rw.Result()
|
||||||
t.Cleanup(func() { _ = res.Body.Close() })
|
t.Cleanup(func() { _ = res.Body.Close() })
|
||||||
require.Equal(t, http.StatusOK, res.StatusCode)
|
require.Equal(t, http.StatusOK, res.StatusCode)
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
@ -243,7 +242,7 @@ func (src *jwtTokenSource) Token() (*oauth2.Token, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if unmarshalError != nil {
|
if unmarshalError != nil {
|
||||||
return nil, fmt.Errorf("oauth2: cannot unmarshal token: %w", err)
|
return nil, xerrors.Errorf("oauth2: cannot unmarshal token: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
newToken := &oauth2.Token{
|
newToken := &oauth2.Token{
|
||||||
@ -264,7 +263,7 @@ func (src *jwtTokenSource) Token() (*oauth2.Token, error) {
|
|||||||
// decode returned id token to get expiry
|
// decode returned id token to get expiry
|
||||||
claimSet, err := jws.Decode(v)
|
claimSet, err := jws.Decode(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("oauth2: error decoding JWT token: %w", err)
|
return nil, xerrors.Errorf("oauth2: error decoding JWT token: %w", err)
|
||||||
}
|
}
|
||||||
newToken.Expiry = time.Unix(claimSet.Exp, 0)
|
newToken.Expiry = time.Unix(claimSet.Exp, 0)
|
||||||
}
|
}
|
||||||
|
@ -807,7 +807,7 @@ func (api *API) runEntitlementsLoop(ctx context.Context) {
|
|||||||
subscribed := false
|
subscribed := false
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
// If this function ends, it means the context was cancelled and this
|
// If this function ends, it means the context was canceled and this
|
||||||
// coderd is shutting down. In this case, post a pubsub message to
|
// coderd is shutting down. In this case, post a pubsub message to
|
||||||
// tell other coderd's to resync their entitlements. This is required to
|
// tell other coderd's to resync their entitlements. This is required to
|
||||||
// make sure things like replica counts are updated in the UI.
|
// make sure things like replica counts are updated in the UI.
|
||||||
|
Reference in New Issue
Block a user