Skip to content

Commit

Permalink
fix: upgrade golangci lint to 1.56.2
Browse files Browse the repository at this point in the history
  • Loading branch information
savsgio committed Mar 3, 2024
1 parent 3597ebc commit c4d6407
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ jobs:
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v3
with:
version: v1.54.2
version: v1.56.2
1 change: 1 addition & 0 deletions hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ func TestLevelHooks_fire(t *testing.T) { // nolint:funlen

hookFired = false
hookEntry = Entry{}

errOutput.Reset()
})
}
Expand Down
14 changes: 8 additions & 6 deletions logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func TestLogger_encodeOutput(t *testing.T) { // nolint:funlen
var wantResult string

enc := new(mockEncoder)
enc.configure = func(cfg Config) {}
enc.configure = func(_ Config) {}
enc.encode = func(buf *Buffer, e Entry) error {
t.Helper()

Expand Down Expand Up @@ -167,7 +167,7 @@ func TestLogger_encodeOutput(t *testing.T) { // nolint:funlen
hookFired := false
hook := &testHook{
levels: []Level{level},
fireFunc: func(e Entry) error {
fireFunc: func(_ Entry) error {
hookFired = true

return nil
Expand Down Expand Up @@ -652,7 +652,7 @@ func testLoggerAddHook(t *testing.T, l *Logger, addHookFunc func(h Hook) error)
args: args{
hook: &testHook{
levels: levels,
fireFunc: func(e Entry) error { return nil },
fireFunc: func(_ Entry) error { return nil },
},
},
want: want{
Expand Down Expand Up @@ -706,8 +706,8 @@ func testLoggerLevels(t *testing.T, l *Logger, testCases []testLoggerLevelCase)
}

enc := new(mockEncoder)
enc.configure = func(c Config) {}
enc.encode = func(b *Buffer, e Entry) error {
enc.configure = func(_ Config) {}
enc.encode = func(_ *Buffer, e Entry) error {
entry = e

return nil
Expand Down Expand Up @@ -773,6 +773,7 @@ func testLoggerLevels(t *testing.T, l *Logger, testCases []testLoggerLevelCase)

t.Run(test.name, func(t *testing.T) {
t.Helper()

defer assertPanic(test.want)

msg := ""
Expand All @@ -784,6 +785,7 @@ func testLoggerLevels(t *testing.T, l *Logger, testCases []testLoggerLevelCase)

t.Run(test.name+"f", func(t *testing.T) {
t.Helper()

defer assertPanic(test.want)

msg := "Hello %s"
Expand Down Expand Up @@ -918,7 +920,7 @@ func BenchmarkLogger_Levels(b *testing.B) { // nolint:funlen
l.SetLevel(DEBUG)
// l.SetFlags(0)

l.exit = func(code int) {}
l.exit = func(_ int) {}

benchs := []struct {
name string
Expand Down
4 changes: 2 additions & 2 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type Hook interface {
// Fire is hook function.
//
// NOTE: The returned error will be written to `os.Stderr`.
Fire(Entry) error
Fire(e Entry) error
}

// Encoder represents the encoders contract.
Expand All @@ -92,7 +92,7 @@ type Encoder interface {
FieldsEncoded() string
SetFieldsEncoded(fieldsEncoded string)
Configure(cfg Config)
Encode(*Buffer, Entry) error
Encode(b *Buffer, e Entry) error
}

// EncoderBase is the base of encoders.
Expand Down

0 comments on commit c4d6407

Please sign in to comment.