Skip to content

[lint-monster] [Lint] Test Set-Type Fixes: map[string]bool → map[string]struct{} - 243 findings #37242

@github-actions

Description

@github-actions

Daily lint scan from 2026-06-06

Issue Summary

The custom linter reports 243 instances of map[string]bool used as sets in test files. The pattern allocates unnecessary bool values per entry; map[string]struct{} is the idiomatic Go approach for set semantics.

Root Cause

  • Test utilities consistently use map[string]bool for membership tracking
  • Pervasive pattern across test suite without central abstraction
  • Memory overhead from bool allocations in sets

Expected Outcome

  • Replace all map[string]bool set patterns with map[string]struct{}
  • Update all write patterns: m[key] = truem[key] = struct{}{}
  • Update read patterns: if m[key]if _, ok := m[key] (or keep simple read as if m[key] for existence check)
  • Validate with make golint-custom

Remediation Checklist

  • Identify which test files have the most occurrences (batch by subsystem if possible)
  • Replace map declarations: map[string]boolmap[string]struct{}
  • Replace set writes: varMap[key] = truevarMap[key] = struct{}{}
  • Audit set reads (usually just if m[key] to check existence, so no change needed for read side)
  • Run make test to verify test behavior is unchanged
  • Run make golint-custom to verify findings are resolved

Notes

  • Pattern is consistent across all test files—fix can be automated or batch-processed
  • No functional change to tests; purely memory efficiency improvement

Generated by 🧌 LintMonster · 110.5 AIC · ⌖ 4.45 AIC ·

  • expires on Jun 13, 2026, 3:51 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions