Skip to content

[lint-monster] String Empty Check Style: Replace len(s) == 0 #38011

Description

@github-actions

Issue Summary

The custom linter has identified 56 instances across the codebase where len(s) == 0 is used to check for empty strings. The idiomatic Go style is to use s == "" instead.

Findings

  • Count: 56 violations
  • Primary packages: pkg/cli, pkg/console, pkg/parser, pkg/stringutil, pkg/gitutil
  • Pattern: All violations use len(s) == 0 which should be s == ""

Affected Files (Sample)

  • pkg/cli/validators.go
  • pkg/cli/yaml_frontmatter_utils.go (4 instances)
  • pkg/console/input.go
  • pkg/gitutil/gitutil.go
  • pkg/stringutil/fuzzy_match.go (2 instances)
  • pkg/parser/github_urls.go
  • pkg/parser/import_directive.go

Remediation

Replace all len(s) == 0 with s == "" across these packages. Simple find-and-replace or automated codemod can resolve this entire group.

Expected Outcome

All 56 instances updated; make golint-custom passes this check.

Generated by 🧌 LintMonster · 146.1 AIC · ⌖ 4.33 AIC · ⊞ 20K ·

  • expires on Jun 15, 2026, 7:50 PM UTC-08:00

Metadata

Metadata

Labels

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