-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Replace strings.Index usages with strings.Cut #4930
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for opening a PR!
I think the purpose of using strings.Cut()
is to split a string into two pieces. strings.Index()
is still the right function to see if a substring can be found.
There are some uses of Index()
that still seem simpler than using Cut()
, IMO.
I think we'd only want to keep the changes in listeners.go, load.go, and addresses.go. The others seem to be more complicated or not quite the right fit.
There may also be some occurrences of SplitN()
that we could replace with Cut()
, if we are splitting only into 2 pieces.
0f092f7
to
12e2ac7
Compare
@mholt Okey, thank you for review ;) I changed it. I will look at the |
Please just do it in this PR, it'll be easier to review all in one place. Also, please remember to sign the CLA. To clarify, the intent of the issue I opened is to find places where we can use the new |
12e2ac7
to
549fad7
Compare
549fad7
to
37e387c
Compare
Okey, I added the changes and signed the CLA. So it is ready to continue the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM!
Thank you for the contribution @WilczynskiT 😃
fixed #4928