Skip to content

Commit

Permalink
chore: bump golangci-lint to v1.61.0 (#7853)
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <[email protected]>
  • Loading branch information
knqyf263 authored Nov 4, 2024
1 parent efec326 commit 4da59bd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
id: lint
uses: golangci/[email protected]
with:
version: v1.59
version: v1.61
args: --verbose --out-format=line-number
if: matrix.operating-system == 'ubuntu-latest'

Expand Down
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ linters-settings:
excludes:
- G101
- G114
- G115
- G204
- G304
- G402
Expand Down
2 changes: 1 addition & 1 deletion magefiles/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (Tool) Wire() error {

// GolangciLint installs golangci-lint
func (t Tool) GolangciLint() error {
const version = "v1.59.1"
const version = "v1.61.0"
bin := filepath.Join(GOBIN, "golangci-lint")
if exists(bin) && t.matchGolangciLintVersion(bin, version) {
return nil
Expand Down
19 changes: 12 additions & 7 deletions pkg/fanal/walker/walk_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package walker_test

import (
"fmt"
"path/filepath"
"testing"

Expand Down Expand Up @@ -42,8 +41,11 @@ func TestSkipFile(t *testing.T) {
},
},
{
name: "multiple skip files",
skipFiles: []string{"/etc/*/*", "/var/log/*.txt"},
name: "multiple skip files",
skipFiles: []string{
"/etc/*/*",
"/var/log/*.txt",
},
wants: map[string]bool{
"/etc/foo": false,
"/etc/foo/bar": true,
Expand All @@ -65,7 +67,7 @@ func TestSkipFile(t *testing.T) {
for file, want := range tt.wants {
file = filepath.ToSlash(filepath.Clean(file))
got := utils.SkipPath(file, utils.CleanSkipPaths(tt.skipFiles))
assert.Equal(t, want, got, fmt.Sprintf("skipFiles: %s, file: %s", tt.skipFiles, file))
assert.Equal(t, want, got, "skipFiles: %s, file: %s", tt.skipFiles, file)
}
})
}
Expand Down Expand Up @@ -108,8 +110,11 @@ func TestSkipDir(t *testing.T) {
},
},
{
name: "multiple dirs",
skipDirs: []string{"/etc/*/*", "/var/log/*"},
name: "multiple dirs",
skipDirs: []string{
"/etc/*/*",
"/var/log/*",
},
wants: map[string]bool{
"/etc/foo": false,
"/etc/foo/bar": true,
Expand Down Expand Up @@ -139,7 +144,7 @@ func TestSkipDir(t *testing.T) {
for dir, want := range tt.wants {
dir = filepath.ToSlash(filepath.Clean(dir))
got := utils.SkipPath(dir, utils.CleanSkipPaths(tt.skipDirs))
assert.Equal(t, want, got, fmt.Sprintf("defaultSkipDirs: %s, dir: %s", tt.skipDirs, dir))
assert.Equal(t, want, got, "defaultSkipDirs: %s, dir: %s", tt.skipDirs, dir)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (m *Manager) Search(ctx context.Context, keyword string) error {
}
}

if _, err = fmt.Fprintf(m.w, buf.String()); err != nil {
if _, err = fmt.Fprint(m.w, buf.String()); err != nil {
return err
}

Expand Down

0 comments on commit 4da59bd

Please sign in to comment.