From 4bbb2a913582df78e4abd59c8b95c937d8e3b4e7 Mon Sep 17 00:00:00 2001 From: Olivier FAURAX Date: Mon, 3 Feb 2025 15:04:26 +0000 Subject: [PATCH] Fix linter mnd --- cmd/curl.go | 2 +- cmd/list/firmware.go | 1 + internal/auth/oauth.go | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/curl.go b/cmd/curl.go index 08a863c8..fce5a27b 100644 --- a/cmd/curl.go +++ b/cmd/curl.go @@ -19,7 +19,7 @@ import ( var curlCmd = &cobra.Command{ Use: "curl fleetdbapi -- args", Short: "Make a curl request with your auth token", - Args: cobra.MinimumNArgs(2), // nolint:gomnd + Args: cobra.MinimumNArgs(2), // nolint:gomnd,mnd Run: func(cmd *cobra.Command, args []string) { apiKind := args[0] if !slices.Contains( diff --git a/cmd/list/firmware.go b/cmd/list/firmware.go index 64a36623..1731f342 100644 --- a/cmd/list/firmware.go +++ b/cmd/list/firmware.go @@ -81,6 +81,7 @@ var listFirmware = &cobra.Command{ } func init() { + // nolint:gomnd,mnd // Set non-0 limit by default, overridden by AddPageLimitFlag flagsDefinedListFirmware = &listFirmwareFlags{limit: 10} mctl.AddVendorFlag(listFirmware, &flagsDefinedListFirmware.vendor) diff --git a/internal/auth/oauth.go b/internal/auth/oauth.go index 23d283b4..c9a44d98 100644 --- a/internal/auth/oauth.go +++ b/internal/auth/oauth.go @@ -194,7 +194,7 @@ func (a *authenticator) keyringStoreToken(token *oauth2.Token) error { func (a *authenticator) authCodePKCE(ctx context.Context, oauthConfig *oauth2.Config, audience string) (*oauth2.Token, error) { tc := make(chan *oauth2.Token) - // nolint:gomnd // state string is limited to 20 random characters + // nolint:gomnd,mnd // state string is limited to 20 random characters c := &authClient{ oauthConfig: oauthConfig, state: randStr(20), @@ -207,7 +207,7 @@ func (a *authenticator) authCodePKCE(ctx context.Context, oauthConfig *oauth2.Co c.handlePKCECallback(ctx, w, r, tc) }) - // nolint:gomnd // read header timeout is set to 30s + // nolint:gomnd,mnd // read header timeout is set to 30s server := &http.Server{Addr: ":18000", ReadHeaderTimeout: time.Second * 30, Handler: mux} go func() {