Skip to content
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

Use strings.ReplaceAll(...) instead of strings.Replace(..., -1) #1104

Closed
wants to merge 1 commit into from
Closed

Use strings.ReplaceAll(...) instead of strings.Replace(..., -1) #1104

wants to merge 1 commit into from

Conversation

alexandear
Copy link
Contributor

Fixes Or Enhances

  • Refactor to strings.ReplaceAll.

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

@alexandear alexandear requested a review from a team as a code owner May 9, 2023 14:35
@coveralls
Copy link

Coverage Status

Coverage: 73.88%. Remained the same when pulling c030413 on alexandear:refactor-replaceall into c8b98cb on go-playground:master.

Copy link
Contributor

@deankarn deankarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any particular reason why as Replace all is just an alias to the existing?

@alexandear
Copy link
Contributor Author

Yes, ReplaceAll it's just an alias. This function was added in Go 1.12 "in the spirit of keeping Go simple". The proposal is here golang/go#27864.

@alexandear alexandear closed this Sep 6, 2023
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.

None yet

4 participants