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 · ◷
Issue Summary
The custom linter has identified 56 instances across the codebase where
len(s) == 0is used to check for empty strings. The idiomatic Go style is to uses == ""instead.Findings
len(s) == 0which should bes == ""Affected Files (Sample)
pkg/cli/validators.gopkg/cli/yaml_frontmatter_utils.go(4 instances)pkg/console/input.gopkg/gitutil/gitutil.gopkg/stringutil/fuzzy_match.go(2 instances)pkg/parser/github_urls.gopkg/parser/import_directive.goRemediation
Replace all
len(s) == 0withs == ""across these packages. Simple find-and-replace or automated codemod can resolve this entire group.Expected Outcome
All 56 instances updated;
make golint-custompasses this check.