Upgrade golangci-lint

This commit is contained in:
Jesper Noordsij 2026-02-23 11:04:04 +01:00 committed by GitHub
parent 7494b5c9ff
commit 288e4e2e2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 8 deletions

View File

@ -7,7 +7,7 @@ on:
env:
GO_VERSION: '1.25'
GOLANGCI_LINT_VERSION: v2.8.0
GOLANGCI_LINT_VERSION: v2.10.1
MISSPELL_VERSION: v0.7.0
jobs:

View File

@ -309,7 +309,7 @@ linters:
text: 'var-naming: avoid meaningless package names'
linters:
- revive
- path: (pkg/muxer/http/.+|pkg/provider/http/.+)\.go
- path: ((cmd|pkg)/version/.*|pkg/config/runtime/.*|pkg/log/.*|pkg/(middlewares/)?metrics/.*|pkg/muxer/http/.+|pkg/provider/http/.+|pkg/tls/.+)\.go
text: 'var-naming: avoid package names that conflict with Go standard library package names'
linters:
- revive

View File

@ -158,7 +158,7 @@ func (c Centrifuge) run(sc *types.Scope, rootPkg string, pkgName string) map[str
func (c Centrifuge) writeStruct(name string, obj *types.Struct, rootPkg string, elt *File) string {
b := strings.Builder{}
b.WriteString(fmt.Sprintf("type %s struct {\n", name))
fmt.Fprintf(&b, "type %s struct {\n", name)
for i := range obj.NumFields() {
field := obj.Field(i)
@ -175,7 +175,7 @@ func (c Centrifuge) writeStruct(name string, obj *types.Struct, rootPkg string,
fType := c.TypeCleaner(field.Type(), rootPkg)
if field.Embedded() {
b.WriteString(fmt.Sprintf("\t%s\n", fType))
fmt.Fprintf(&b, "\t%s\n", fType)
continue
}
@ -184,10 +184,10 @@ func (c Centrifuge) writeStruct(name string, obj *types.Struct, rootPkg string,
continue
}
b.WriteString(fmt.Sprintf("\t%s %s", field.Name(), fType))
fmt.Fprintf(&b, "\t%s %s", field.Name(), fType)
if ok {
b.WriteString(fmt.Sprintf(" `json:\"%s\"`", strings.Join(values, ",")))
fmt.Fprintf(&b, " `json:\"%s\"`", strings.Join(values, ","))
}
b.WriteString("\n")

View File

@ -300,7 +300,7 @@ THIS FILE MUST NOT BE EDITED BY HAND
}
if w.err != nil {
logger.Fatal(err)
logger.Fatal(w.err)
}
}

View File

@ -3,7 +3,7 @@ package acme
import "os"
// CheckFile checks file content size
// Do not check file permissions on Windows right now
// Do not check file permissions on Windows right now.
func CheckFile(name string) (bool, error) {
f, err := os.Open(name)
if err != nil {