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

refactor: replace strings.Replace with strings.ReplaceAll #15392

Merged
merged 1 commit into from
Aug 3, 2022
Merged

refactor: replace strings.Replace with strings.ReplaceAll #15392

merged 1 commit into from
Aug 3, 2022

Conversation

Juneezee
Copy link
Contributor

Replace strings.Replace(s, old, new, -1) with strings.ReplaceAll(s, old, new). strings.ReplaceAll is a wrapper function for strings.Replace, but strings.ReplaceAll is more readable and removes the hardcoded -1.

@Juneezee Juneezee requested a review from a team May 12, 2022 11:26
strings.ReplaceAll(s, old, new) is a wrapper function for
strings.Replace(s, old, new, -1). But strings.ReplaceAll is more
readable and removes the hardcoded -1.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Copy link
Contributor

@ccapurso ccapurso left a comment

Choose a reason for hiding this comment

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

Definitely more readable. Thank you for the submission!

@ccapurso ccapurso merged commit 6141d61 into hashicorp:main Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants