Skip to content

Commit ff27d27

Browse files
committed
bytes: use "subslice" instead of "substring" in doc comments
The bytes package iterators return subslices, not substrings. Updates #61901. Change-Id: Ida91d3e33a0f178edfe9a267861adf4f13f9a965 Reviewed-on: https://go-review.googlesource.com/c/go/+/647875 Reviewed-by: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 215de81 commit ff27d27

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/bytes/iter.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,26 @@ func splitSeq(s, sep []byte, sepSave int) iter.Seq[[]byte] {
6767
}
6868
}
6969

70-
// SplitSeq returns an iterator over all substrings of s separated by sep.
71-
// The iterator yields the same strings that would be returned by [Split](s, sep),
72-
// but without constructing the slice.
70+
// SplitSeq returns an iterator over all subslices of s separated by sep.
71+
// The iterator yields the same subslices that would be returned by [Split](s, sep),
72+
// but without constructing a new slice containing the subslices.
7373
// It returns a single-use iterator.
7474
func SplitSeq(s, sep []byte) iter.Seq[[]byte] {
7575
return splitSeq(s, sep, 0)
7676
}
7777

78-
// SplitAfterSeq returns an iterator over substrings of s split after each instance of sep.
79-
// The iterator yields the same strings that would be returned by [SplitAfter](s, sep),
80-
// but without constructing the slice.
78+
// SplitAfterSeq returns an iterator over subslices of s split after each instance of sep.
79+
// The iterator yields the same subslices that would be returned by [SplitAfter](s, sep),
80+
// but without constructing a new slice containing the subslices.
8181
// It returns a single-use iterator.
8282
func SplitAfterSeq(s, sep []byte) iter.Seq[[]byte] {
8383
return splitSeq(s, sep, len(sep))
8484
}
8585

86-
// FieldsSeq returns an iterator over substrings of s split around runs of
86+
// FieldsSeq returns an iterator over subslices of s split around runs of
8787
// whitespace characters, as defined by [unicode.IsSpace].
88-
// The iterator yields the same strings that would be returned by [Fields](s),
89-
// but without constructing the slice.
88+
// The iterator yields the same subslices that would be returned by [Fields](s),
89+
// but without constructing a new slice containing the subslices.
9090
func FieldsSeq(s []byte) iter.Seq[[]byte] {
9191
return func(yield func([]byte) bool) {
9292
start := -1
@@ -116,10 +116,10 @@ func FieldsSeq(s []byte) iter.Seq[[]byte] {
116116
}
117117
}
118118

119-
// FieldsFuncSeq returns an iterator over substrings of s split around runs of
119+
// FieldsFuncSeq returns an iterator over subslices of s split around runs of
120120
// Unicode code points satisfying f(c).
121-
// The iterator yields the same strings that would be returned by [FieldsFunc](s),
122-
// but without constructing the slice.
121+
// The iterator yields the same subslices that would be returned by [FieldsFunc](s),
122+
// but without constructing a new slice containing the subslices.
123123
func FieldsFuncSeq(s []byte, f func(rune) bool) iter.Seq[[]byte] {
124124
return func(yield func([]byte) bool) {
125125
start := -1

0 commit comments

Comments
 (0)