diff --git a/.golangci.yml b/.golangci.yml index 43af4c3..1fbb8db 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -41,6 +41,7 @@ linters: - maintidx # maintidx measures the maintainability index of each function. - makezero # Finds slice declarations with non-zero initial length - misspell # Finds commonly misspelled English words in comments + - modernize # Replace and suggests simplifications to code - nakedret # Finds naked returns in functions greater than a specified function length - nestif # Reports deeply nested if statements - nilerr # Finds the code that returns nil even if it checks that the error is not nil. diff --git a/json_logger.go b/json_logger.go index f21a27d..ce7ca40 100644 --- a/json_logger.go +++ b/json_logger.go @@ -308,8 +308,8 @@ func newJSONLoggerFactory() *jsonLoggerFactory { continue } - scopes := strings.Split(strings.ToLower(env), ",") - for _, scope := range scopes { + scopes := strings.SplitSeq(strings.ToLower(env), ",") + for scope := range scopes { factory.scopeLevels[scope] = level } } diff --git a/logger.go b/logger.go index 3af89fe..5b18530 100644 --- a/logger.go +++ b/logger.go @@ -220,8 +220,8 @@ func NewDefaultLoggerFactory() *DefaultLoggerFactory { continue } - scopes := strings.Split(strings.ToLower(env), ",") - for _, scope := range scopes { + scopes := strings.SplitSeq(strings.ToLower(env), ",") + for scope := range scopes { factory.ScopeLevels[scope] = level } }