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

fix: do not check `static-msg` for `With` functions #45

Closed tigrato closed 1 month ago

tigrato commented 1 month ago

In With functions, msgPos := funcInfo.argsPos - 1 resolves to -1 because these functions do not have a message argument. This causes a panic when static-msg is enabled. Added a check to ensure msgPos is valid before proceeding.

Fixes #46

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.58%. Comparing base (f87bbdf) to head (26938aa). Report is 8 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #45 +/- ## ========================================== - Coverage 84.06% 83.58% -0.48% ========================================== Files 2 2 Lines 251 262 +11 ========================================== + Hits 211 219 +8 - Misses 33 35 +2 - Partials 7 8 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.