From a7bba266b4c08f9565f0b60e1d964e0324eea100 Mon Sep 17 00:00:00 2001 From: Viktor Date: Tue, 7 May 2024 09:28:46 +0200 Subject: [PATCH] feat: [NA] update golagci-lint config; code cleanup --- .golangci.yaml | 2 +- internal/handler/callback/callbackdata/parser.go | 2 +- internal/module/gcp/secrets/secrets.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index c9bfc02..71550d1 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -24,7 +24,7 @@ linters: - gochecknoinits # Checks that no init functions are present in Go code. - godot # Check if comments end in a period - godox # Tool for detection of FIXME, TODO and other comment keywords - - goerr113 # Golang linter to check the errors handling expressions + - err113 # Golang linter to check the errors handling expressions - gomnd # An analyzer to detect magic numbers - ireturn # Accept Interfaces, Return Concrete Types - interfacebloat # A linter that checks the number of methods inside an interface diff --git a/internal/handler/callback/callbackdata/parser.go b/internal/handler/callback/callbackdata/parser.go index add2d65..680ac38 100644 --- a/internal/handler/callback/callbackdata/parser.go +++ b/internal/handler/callback/callbackdata/parser.go @@ -13,7 +13,7 @@ type Payload struct { func Parse(data string) (*Payload, error) { splits := strings.Split(data, "_") - if len(splits) != 2 { + if len(splits) != 2 { //nolint:gomnd,mnd return nil, fmt.Errorf("invalid callback query data token: %v", splits) } diff --git a/internal/module/gcp/secrets/secrets.go b/internal/module/gcp/secrets/secrets.go index 58163cf..35abcf4 100644 --- a/internal/module/gcp/secrets/secrets.go +++ b/internal/module/gcp/secrets/secrets.go @@ -30,7 +30,7 @@ func (c Client) GetSecretValue(ctx context.Context, name string) (string, error) if err != nil { return "", fmt.Errorf("secret access request: %w", err) } - if resp.HTTPStatusCode != 200 { + if resp.HTTPStatusCode != 200 { //nolint:gomnd,mnd return "", fmt.Errorf("secret access request: code=%d, data=%v", resp.HTTPStatusCode, resp.Payload.Data) }