]> Cypherpunks repositories - gostls13.git/commitdiff
bytes: fix Cut godoc typo
authorkjgorman <kieran.j.gorman@gmail.com>
Sun, 10 Oct 2021 13:30:26 +0000 (14:30 +0100)
committerAlexander Rakoczy <alex@golang.org>
Wed, 13 Oct 2021 16:39:23 +0000 (16:39 +0000)
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>

src/bytes/bytes.go

index d3e01c3de7b90edd655c7619652dec64e3932a28..926f65cc8f854e23794779758ecd45a894747236 100644 (file)
@@ -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) {