From 0a06205032e537d9d5699ac35805d37937a45178 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Fri, 8 Nov 2024 13:23:54 +0100 Subject: [PATCH] Fix/Update linter Signed-off-by: Ulysses Souza --- .golangci.yaml | 8 +++----- dao/default_dao.go | 1 - envlang.go | 2 +- handlers/valuehandler.go | 2 +- handlers/valuehandler_helper.go | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 4e914fc..108059f 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -10,8 +10,7 @@ run: # Timeout for analysis, e.g. 30s, 5m. # Default: 1m - timeout: 3m - + timeout: 2m # This file contains only configs which differ from defaults. # All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml @@ -178,9 +177,8 @@ linters: - durationcheck # checks for two durations multiplied together - errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error - errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13 - - execinquery # checks query string in Query function which reads your Go src files and warning it finds - exhaustive # checks exhaustiveness of enum switch statements - - exportloopref # checks for pointers to enclosing loop variables + - copyloopvar # checks for pointers to enclosing loop variables - forbidigo # forbids identifiers - funlen # tool for detection of long functions - gocheckcompilerdirectives # validates go compiler directive comments (//go:) @@ -192,7 +190,7 @@ linters: - gocyclo # computes and checks the cyclomatic complexity of functions - godot # checks if comments end in a period - goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt - - gomnd # detects magic numbers + - mnd # detects magic numbers - gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod - gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations - goprintffuncname # checks that printf-like functions are named with f at the end diff --git a/dao/default_dao.go b/dao/default_dao.go index 761eec2..9a2156a 100644 --- a/dao/default_dao.go +++ b/dao/default_dao.go @@ -66,7 +66,6 @@ func (d *DefaultDao) ImportMap(m map[string]string) { defer d.Unlock() for k, v := range m { - v := v d.m[k] = &v } } diff --git a/envlang.go b/envlang.go index 43c1a7a..1ed00b4 100644 --- a/envlang.go +++ b/envlang.go @@ -4,7 +4,7 @@ import ( "io" "os" - "github.com/antlr4-go/antlr/v4" + antlr "github.com/antlr4-go/antlr/v4" "github.com/ulyssessouza/envlang/dao" "github.com/ulyssessouza/envlang/gen/fileparser" "github.com/ulyssessouza/envlang/handlers" diff --git a/handlers/valuehandler.go b/handlers/valuehandler.go index bba7465..629f9c2 100644 --- a/handlers/valuehandler.go +++ b/handlers/valuehandler.go @@ -3,7 +3,7 @@ package handlers import ( "strings" - "github.com/antlr4-go/antlr/v4" + antlr "github.com/antlr4-go/antlr/v4" log "github.com/sirupsen/logrus" "github.com/ulyssessouza/envlang/gen/valueparser" ) diff --git a/handlers/valuehandler_helper.go b/handlers/valuehandler_helper.go index a2ce095..6cc3796 100644 --- a/handlers/valuehandler_helper.go +++ b/handlers/valuehandler_helper.go @@ -1,7 +1,7 @@ package handlers import ( - "github.com/antlr4-go/antlr/v4" + antlr "github.com/antlr4-go/antlr/v4" log "github.com/sirupsen/logrus" "github.com/ulyssessouza/envlang/dao" "github.com/ulyssessouza/envlang/gen/valueparser"