feat(linter): enable errcheck linter in golangci-lint

Also, bump the linter version to the latest available version.

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
Milos Gajdos
2023-11-18 06:50:40 +00:00
parent 9610a1e618
commit 7ce129d63b
36 changed files with 243 additions and 66 deletions

View File

@@ -14,6 +14,7 @@ import (
"github.com/distribution/distribution/v3/registry/auth"
"github.com/go-jose/go-jose/v3"
"github.com/sirupsen/logrus"
)
// accessSet maps a typed, named resource to
@@ -339,5 +340,7 @@ func (ac *accessController) Authorized(req *http.Request, accessItems ...auth.Ac
// init handles registering the token auth backend.
func init() {
auth.Register("token", auth.InitFunc(newAccessController))
if err := auth.Register("token", auth.InitFunc(newAccessController)); err != nil {
logrus.Errorf("tailed to register token auth: %v", err)
}
}

View File

@@ -22,7 +22,10 @@ func FuzzToken1(f *testing.F) {
if err != nil {
return
}
token.Verify(verifyOps)
_, err = token.Verify(verifyOps)
if err != nil {
return
}
_, _ = token.VerifySigningKey(verifyOps)
})
}
@@ -40,7 +43,10 @@ func FuzzToken2(f *testing.F) {
if err != nil {
return
}
token.Verify(verifyOps)
_, err = token.Verify(verifyOps)
if err != nil {
return
}
_, _ = token.VerifySigningKey(verifyOps)
})
}