You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find the use of the identifier "sep", in the description of func Index, to be confusing. On first reading I interpreted it to mean that Index would find the first occurrence in s of any of a set of "separator" characters. I suggest renaming "sep" to "substr", which would be consistent with strings.Contains.
A similar argument would apply to strings.Count and strings.LastIndex. However, the use of "sep" in strings.Join is clear as currently written.
The several Split... functions could possibly also be clarified by changing the first mention of "sep" in the prose of each to "the substring sep".
The text was updated successfully, but these errors were encountered:
Thanks for the report. I did not address this part
The several Split... functions could possibly also be clarified by changing the first mention of "sep" in the prose of each to "the substring sep".
in my patch because I read the documentation and I think it's clear enough. The use of sep as parameter name in Split is fine, and when sep is actually a set of separators we usually specify it, so just leaving it as "Split slices s into all substrings separated by sep" should be ok, I don't think adding "substring" before "sep" would make it clearer.
In the documentation of the function Index, in package strings:
(referencing https://golang.org/pkg/strings/#Index as of 11 Feb 2017)
I find the use of the identifier "sep", in the description of func Index, to be confusing. On first reading I interpreted it to mean that Index would find the first occurrence in s of any of a set of "separator" characters. I suggest renaming "sep" to "substr", which would be consistent with strings.Contains.
A similar argument would apply to strings.Count and strings.LastIndex. However, the use of "sep" in strings.Join is clear as currently written.
The several Split... functions could possibly also be clarified by changing the first mention of "sep" in the prose of each to "the substring sep".
The text was updated successfully, but these errors were encountered: