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

Reconsider checking `slog.With` and `slog.Logger.With` #49

Closed AlekSi closed 2 weeks ago

AlekSi commented 2 weeks ago

With kv-only: false, attr-only: true calls like l.With("a", "b") are reported as "key-value pairs should not be used". But there is no non-kv API for that operation.

tmzane commented 2 weeks ago

But there is no non-kv API for that operation.

slog.With(slog.String("a", "b")).Info("test")

@AlekSi the above works for me 🤔

AlekSi commented 2 weeks ago

Doh! You right, sorry for the noise