aboutsummaryrefslogtreecommitdiff
path: root/src/strings/strings.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings/strings.go')
-rw-r--r--src/strings/strings.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/strings/strings.go b/src/strings/strings.go
index 95180828f6..fba303c12a 100644
--- a/src/strings/strings.go
+++ b/src/strings/strings.go
@@ -121,7 +121,7 @@ func IndexByte(s string, c byte) int {
// IndexRune returns the index of the first instance of the Unicode code point
// r, or -1 if rune is not present in s.
-// If r is utf8.RuneError, it returns the first instance of any
+// If r is [utf8.RuneError], it returns the first instance of any
// invalid UTF-8 byte sequence.
func IndexRune(s string, r rune) int {
switch {
@@ -275,7 +275,7 @@ func genSplit(s, sep string, sepSave, n int) []string {
// Edge cases for s and sep (for example, empty strings) are handled
// as described in the documentation for [Split].
//
-// To split around the first instance of a separator, see Cut.
+// To split around the first instance of a separator, see [Cut].
func SplitN(s, sep string, n int) []string { return genSplit(s, sep, 0, n) }
// SplitAfterN slices s into substrings after each instance of sep and
@@ -304,7 +304,7 @@ func SplitAfterN(s, sep string, n int) []string {
//
// It is equivalent to [SplitN] with a count of -1.
//
-// To split around the first instance of a separator, see Cut.
+// To split around the first instance of a separator, see [Cut].
func Split(s, sep string) []string { return genSplit(s, sep, 0, -1) }
// SplitAfter slices s into all substrings after each instance of sep and
@@ -324,7 +324,7 @@ func SplitAfter(s, sep string) []string {
var asciiSpace = [256]uint8{'\t': 1, '\n': 1, '\v': 1, '\f': 1, '\r': 1, ' ': 1}
// Fields splits the string s around each instance of one or more consecutive white space
-// characters, as defined by unicode.IsSpace, returning a slice of substrings of s or an
+// characters, as defined by [unicode.IsSpace], returning a slice of substrings of s or an
// empty slice if s contains only white space.
func Fields(s string) []string {
// First count the fields.