Skip to content

fix: replace if+TrimSuffix with unconditional TrimSuffix (staticcheck S1017)#28

Merged
vdemeester merged 1 commit intomainfrom
fix/lint-staticcheck-s1017
Feb 23, 2026
Merged

fix: replace if+TrimSuffix with unconditional TrimSuffix (staticcheck S1017)#28
vdemeester merged 1 commit intomainfrom
fix/lint-staticcheck-s1017

Conversation

@vdemeester
Copy link
Copy Markdown
Owner

Fixes the CI lint failure on main.

Problem: staticcheck S1017 flags the pattern of checking strings.HasSuffix before calling strings.TrimSuffix, since TrimSuffix is already a no-op when the suffix isn't present.

Fix: Replace the guarded if strings.HasSuffix(...) { ... = strings.TrimSuffix(...) } with a direct strings.TrimSuffix(...) call.

File: pkg/parser/parser.go:598

… S1017)

Use strings.TrimSuffix unconditionally instead of guarding it with
strings.HasSuffix, as TrimSuffix is already a no-op when the suffix
is not present.
@vdemeester vdemeester merged commit c12e08e into main Feb 23, 2026
3 checks passed
@vdemeester vdemeester deleted the fix/lint-staticcheck-s1017 branch February 23, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant