Skip to content

[lint-monster] Use strings.EqualFold for case-insensitive comparison (21 locations) #36566

@github-actions

Description

@github-actions

Summary

Daily custom lint scan identified 21 locations where case-insensitive string comparison is performed using strings.ToLower() or strings.ToUpper() with ==. These should use strings.EqualFold() instead.

Root Cause

Using strings.ToLower(a) == strings.ToLower(b) is inefficient and less idiomatic than strings.EqualFold(a, b). The EqualFold function is optimized for Unicode case-insensitive comparison and doesn't require creating intermediate strings.

Affected Locations

  • pkg/parser/schema_suggestions.go:666
  • pkg/parser/yaml_import.go:39 (2 instances)
  • pkg/workflow/features.go:69,105
  • pkg/workflow/notify_comment.go:630
  • pkg/workflow/repo_memory_validation.go:52
  • pkg/workflow/resolve.go:173,189,227 (5 instances total)
  • pkg/workflow/strings.go:224
  • pkg/workflow/tools_validation_github.go:191
  • pkg/cli/add_workflow_resolution.go:459
  • pkg/cli/codemod_discussion_trigger_categories.go:68
  • pkg/cli/codespace.go:17
  • pkg/cli/forecast.go:462 (2 instances)
  • pkg/cli/import_url_fetcher.go:218
  • pkg/cli/logs_report_tools.go:56
  • pkg/cli/outcome_eval_review.go:79

Remediation Strategy

Simple find-replace for each pattern:

Pattern 1: strings.ToLower(a) == strings.ToLower(b)

Before:

if strings.ToLower(a) == strings.ToLower(b) { ... }

After:

if strings.EqualFold(a, b) { ... }

Pattern 2: strings.ToUpper(a) == strings.ToUpper(b)

Before:

if strings.ToUpper(a) == strings.ToUpper(b) { ... }

After:

if strings.EqualFold(a, b) { ... }

Validation

  1. Run make golint-custom to verify all issues fixed
  2. Run go test -v ./... to ensure no behavior changes
  3. Verify CI passes

Priority

This is a straightforward refactoring with zero behavioral impact. Can be applied across all 21 locations at once.

Estimated Effort

Very low - 21 simple replacements with no logic changes.

Generated by 🧌 LintMonster · haiku45 75K ·

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

Metadata

Metadata

Assignees

No one assigned

    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