-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
What did you expect to see?
// split slices s into two substrings separated by the first occurrence of
// sep. If cutc is true then sep is excluded from the second substring.
// If sep does not occur in s then s and the empty string is returned.
func split(s string, sep byte, cutc bool) (string, string) {
i := strings.IndexByte(s, sep)
if i < 0 {
return s, ""
}
if cutc {
return s[:i], s[i+1:]
}
return s[:i], s[i:]
}
What did you see instead?
// split slices s into two substrings separated by the first occurrence of
// sep. If cutc is true then sep is included with the second substring.
// If sep does not occur in s then s and the empty string is returned.
func split(s string, sep byte, cutc bool) (string, string) {
i := strings.IndexByte(s, sep)
if i < 0 {
return s, ""
}
if cutc {
return s[:i], s[i+1:]
}
return s[:i], s[i:]
}
Lines 454 to 466 in 39a9cb4
| // split slices s into two substrings separated by the first occurrence of | |
| // sep. If cutc is true then sep is included with the second substring. | |
| // If sep does not occur in s then s and the empty string is returned. | |
| func split(s string, sep byte, cutc bool) (string, string) { | |
| i := strings.IndexByte(s, sep) | |
| if i < 0 { | |
| return s, "" | |
| } | |
| if cutc { | |
| return s[:i], s[i+1:] | |
| } | |
| return s[:i], s[i:] | |
| } |
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.