Skip to content

Fix warning QF1004 of staticcheck #3684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

mamo3gr
Copy link
Contributor

@mamo3gr mamo3gr commented Mar 27, 2025

Problem

A linter Staticcheck, which could be included in golangci-lint, warns QF1004 in the generated code:
https://staticcheck.dev/docs/checks/#QF1004

Use strings.ReplaceAll instead of strings.Replace with n == -1

Solution

Do what the linter says.
There seems not to be any drawback so all replacement are applied in an automatic manner (including test data).

@raphael
Copy link
Member

raphael commented Mar 27, 2025

This is great, thank you!

@raphael raphael enabled auto-merge (squash) March 27, 2025 17:47
@raphael raphael merged commit 22cc08c into goadesign:v3 Mar 27, 2025
13 checks passed
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.

2 participants