update golint
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
andrey1s
2022-09-06 22:20:42 +03:00
parent 5eb77a7858
commit d0f3c7e4d0
9 changed files with 25 additions and 13 deletions

View File

@@ -37,6 +37,17 @@ linters-settings:
linters: linters:
enable-all: true enable-all: true
disable:
- exhaustivestruct
- maligned
- deadcode
- interfacer
- golint
- varcheck
- nosnakecase
- scopelint
- ifshort
- structcheck
issues: issues:
# Excluding configuration per-path, per-linter, per-text and per-source # Excluding configuration per-path, per-linter, per-text and per-source
@@ -44,5 +55,5 @@ issues:
- path: _test\.go - path: _test\.go
linters: linters:
- gomnd - gomnd
- exhaustivestruct
- ireturn - ireturn
- exhaustruct

View File

@@ -4,7 +4,7 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"io/ioutil" "io"
"testing" "testing"
"time" "time"
@@ -118,7 +118,7 @@ func fakeSugarFields() []interface{} {
} }
func NewLogger() log.Logger { func NewLogger() log.Logger {
return log.New(log.WithWriter(ioutil.Discard)) return log.New(log.WithWriter(io.Discard))
} }
func BenchmarkDisabledWithoutFields(b *testing.B) { func BenchmarkDisabledWithoutFields(b *testing.B) {

View File

@@ -2,6 +2,7 @@ package field
import "time" import "time"
//nolint:interfacebloat
type Encoder interface { type Encoder interface {
// Built-in types. // Built-in types.
AddArray(key string, value Value) AddArray(key string, value Value)

View File

@@ -261,7 +261,7 @@ func (f Field) AddTo(enc Encoder) {
switch { switch {
case f.value.IsArray(): case f.value.IsArray():
enc.AddAny(key, f.value) enc.AddArray(key, f.value)
case f.value.IsNil(): case f.value.IsNil():
enc.AddNil(key) enc.AddNil(key)
case f.value.IsBool(): case f.value.IsBool():

View File

@@ -6,7 +6,7 @@ import (
type Key string type Key string
//nolint: gocyclo,funlen,cyclop //nolint:funlen,cyclop,gocyclo
func (k Key) Any(value interface{}) Field { func (k Key) Any(value interface{}) Field {
switch val := value.(type) { switch val := value.(type) {
case string: case string: