update linter
All checks were successful
Go Action / goaction (pull_request) Successful in 36s
Go Action / goaction (push) Successful in 31s

This commit is contained in:
2026-03-02 18:48:41 +03:00
parent b98f4514af
commit 079d40b48f
6 changed files with 9 additions and 15 deletions

View File

@@ -17,7 +17,7 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v8 # Use the golangci-lint action
with:
version: v2.7.2 # Specify the linter version
version: v2.10.1 # Specify the linter version
# Optional: additional arguments
args: --verbose

View File

@@ -4,6 +4,7 @@ linters:
disable:
- wsl
- noinlineerr
- revive
settings:
depguard:
rules:
@@ -21,20 +22,11 @@ linters:
- "*.UnmarshalText"
- "*.UnmarshalJSON"
- "*.UnmarshalBinary"
dupl:
threshold: 100
exhaustive:
default-signifies-exhaustive: true
funlen:
lines: 100
statements: 50
goconst:
min-len: 2
min-occurrences: 2
gocyclo:
min-complexity: 15
lll:
line-length: 140
misspell:
locale: US
tagliatelle:

View File

@@ -250,7 +250,7 @@ func (b BaseEncoder) appendField(dst []byte, field Field, prefix string, deli by
return b.appendValue(dst, field.Value, field.Key+".", deli)
}
//nolint:mnd,gocyclo,cyclop
//nolint:mnd,cyclop
func (b BaseEncoder) appendValue(dst []byte, val Value, prefix string, deli byte) []byte {
switch val.Kind {
case KindGroup:

View File

@@ -37,7 +37,7 @@ func (l Kind) MarshalText() ([]byte, error) {
return []byte(l.String()), nil
}
//nolint:gocyclo,cyclop,funlen
//nolint:cyclop,funlen
func (l *Kind) UnmarshalText(in []byte) error {
switch string(in) {
case KindAny.String():

View File

@@ -469,7 +469,7 @@ func (v Value) String() string {
return string(v.append(buf))
}
//nolint:gocyclo,cyclop
//nolint:cyclop
func (v Value) Any() any {
switch v.Kind {
case KindAny, KindBinary:

View File

@@ -28,7 +28,8 @@ func TestFields(t *testing.T) {
buf := &bytes.Buffer{}
log := log.New(log.WithWriter(buf)).
With(log.WithLevel(log.KeyLevel, level.Info))
success := "msg=message err=\"file already exists\" version=0.1.0 obj={id:uid} closure=\"some closure data\" level=info\n"
success := "msg=message err=\"file already exists\"" +
" version=0.1.0 obj={id:uid} closure=\"some closure data\" level=info\n"
log.InfoKVs(ctx, "message",
"err", os.ErrExist,
@@ -63,7 +64,8 @@ func TestWriter(t *testing.T) {
ctx := context.Background()
success := "msg=\"info message\" err=\"file already exists\" requestID=6a5fa048-7181-11ea-bc55-0242ac1311113 level=info\n"
success := "msg=\"info message\" err=\"file already exists\"" +
" requestID=6a5fa048-7181-11ea-bc55-0242ac1311113 level=info\n"
buf := &bytes.Buffer{}
logger := log.New(log.WithWriter(buf)).With(log.WithContextValue(requestID), log.WithLevel(log.KeyLevel, level.Info))