Skip to content

Commit

Permalink
Lint fix (#1235)
Browse files Browse the repository at this point in the history
* fix error name

* tweak interface

* disable recvcheck

---------

Co-authored-by: Daisuke Maki <[email protected]>
  • Loading branch information
lestrrat and Daisuke Maki authored Nov 11, 2024
1 parent 0088ca7 commit 27f2f3f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ linters:
- nonamedreturns # visit this back later
- paralleltest
- perfsprint
- recvcheck
- tagliatelle
- testifylint # TODO: revisit when we have the chance
- testpackage
Expand Down
1 change: 1 addition & 0 deletions jwk/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ func (c *Cache) Unregister(ctx context.Context, u string) error {
// Make sure that you read the documentation for `jwk.Cache` as well.
type CachedSet interface {
Set
cached() (Set, error) // used as a marker
}

type cachedSet struct {
Expand Down
10 changes: 5 additions & 5 deletions jwt/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,20 @@ func TokenExpiredError() error {
return errDefaultTokenExpired
}

type invalidIssuedAt struct {
type invalidIssuedAtError struct {
error
}

func (err invalidIssuedAt) Is(target error) bool {
_, ok := target.(invalidIssuedAt)
func (err invalidIssuedAtError) Is(target error) bool {
_, ok := target.(invalidIssuedAtError)
return ok
}

func (err invalidIssuedAt) Unwrap() error {
func (err invalidIssuedAtError) Unwrap() error {
return err.error
}

var errDefaultInvalidIssuedAt = invalidIssuedAt{errors.New(`"iat" not satisfied`)}
var errDefaultInvalidIssuedAt = invalidIssuedAtError{errors.New(`"iat" not satisfied`)}

// InvalidIssuedAtError returns the immutable error used when `iat` claim
// is not satisfied
Expand Down

0 comments on commit 27f2f3f

Please sign in to comment.