go-simpler / sloglint

🪵 Ensure consistent code style when using log/slog
https://go-simpler.org/sloglint
Mozilla Public License 2.0
75 stars 5 forks source link

"key-value pairs should not be used" check false positive #48

Closed AlekSi closed 2 weeks ago

AlekSi commented 2 weeks ago

I'm using sloglint 0.7.1 with golangci-lint 1.59.1. My options are: no-mixed-args: true, kv-only: false, attr-only: true.

I have the following line of code:

l.LogAttrs(context.Background(), slog.LevelInfo, "Hello", fields...)

With the options above, it is reported as "key-value pairs should not be used". But LogAttrs accepts ...slog.Attr, not key-value pairs.

tmzane commented 2 weeks ago

Thanks for the report. Can confirm, this is not working as intended. I'll take a look shortly.