You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: impossible nil != nil conditions and unused symbols in logpattern test/mock files #20
These are dead-code guards that can never execute. Likely a copy-paste error where the variable being checked was changed to a value type but the nil comparison was left behind.
Unused writes to struct fields (logpattern_security_test.go lines 785–788)
config.Patterns=...// written but never read
config.JournalUnits=...// written but never read
config.MaxEventsPerPattern=...// written but never read
config.DedupWindow=...// written but never read
Unused symbols (logpattern_mocks.go)
Line 203: method getCalls — defined but never called
Line 208: method wasCalled — defined but never called
Line 238: const testKernelPanicLog — defined but never referenced
Steps to Reproduce
go vet ./pkg/monitors/custom/...
staticcheck ./pkg/monitors/custom/...
Suggested Action
Fix nil checks to compare the correct variable, or remove if the guard is no longer needed.
Remove or actually exercise the unused fields/methods/const.
Add staticcheck to CI to catch these going forward.
Activity