mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
bytes: fix Cut godoc typo
If sep does not appear in s, we return nil here rather than the empty string. Presumably the docs were copied from the strings package implementation and brought that along. Change-Id: I3706c94fe04abd9e2a2c8840f7cc6116386965c8 Reviewed-on: https://go-review.googlesource.com/c/go/+/354969 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Alexander Rakoczy <alex@golang.org>
This commit is contained in:
parent
69041c79dc
commit
3986e5c8e7
1 changed files with 1 additions and 1 deletions
|
|
@ -1260,7 +1260,7 @@ func Index(s, sep []byte) int {
|
|||
// Cut slices s around the first instance of sep,
|
||||
// returning the text before and after sep.
|
||||
// The found result reports whether sep appears in s.
|
||||
// If sep does not appear in s, cut returns s, "", false.
|
||||
// If sep does not appear in s, cut returns s, nil, false.
|
||||
//
|
||||
// Cut returns slices of the original slice s, not copies.
|
||||
func Cut(s, sep []byte) (before, after []byte, found bool) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue