From 3986e5c8e7df958cc1412ad06afc011022da76e1 Mon Sep 17 00:00:00 2001 From: kjgorman Date: Sun, 10 Oct 2021 14:30:26 +0100 Subject: [PATCH] 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 Trust: Alexander Rakoczy --- src/bytes/bytes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bytes/bytes.go b/src/bytes/bytes.go index d3e01c3de7..926f65cc8f 100644 --- a/src/bytes/bytes.go +++ b/src/bytes/bytes.go @@ -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) { -- 2.50.0