Skip to content

Commit 611f18c

Browse files
kolyshkingopherbot
authored andcommitted
strings: more cross-references in docstrings
This amends CL 534775. Change-Id: I25a217da51853ec29106998e19e9386d756902fc Reviewed-on: https://go-review.googlesource.com/c/go/+/597655 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]>
1 parent 08a6e08 commit 611f18c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/strings/compare.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import "internal/bytealg"
1010
// The result will be 0 if a == b, -1 if a < b, and +1 if a > b.
1111
//
1212
// Use Compare when you need to perform a three-way comparison (with
13-
// slices.SortFunc, for example). It is usually clearer and always faster
13+
// [slices.SortFunc], for example). It is usually clearer and always faster
1414
// to use the built-in string comparison operators ==, <, >, and so on.
1515
func Compare(a, b string) int {
1616
return bytealg.CompareString(a, b)

src/strings/replace.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ func makeGenericReplacer(oldnew []string) *genericReplacer {
299299

300300
type appendSliceWriter []byte
301301

302-
// Write writes to the buffer to satisfy io.Writer.
302+
// Write writes to the buffer to satisfy [io.Writer].
303303
func (w *appendSliceWriter) Write(p []byte) (int, error) {
304304
*w = append(*w, p...)
305305
return len(p), nil

src/strings/strings.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func IndexByte(s string, c byte) int {
121121

122122
// IndexRune returns the index of the first instance of the Unicode code point
123123
// r, or -1 if rune is not present in s.
124-
// If r is utf8.RuneError, it returns the first instance of any
124+
// If r is [utf8.RuneError], it returns the first instance of any
125125
// invalid UTF-8 byte sequence.
126126
func IndexRune(s string, r rune) int {
127127
switch {
@@ -275,7 +275,7 @@ func genSplit(s, sep string, sepSave, n int) []string {
275275
// Edge cases for s and sep (for example, empty strings) are handled
276276
// as described in the documentation for [Split].
277277
//
278-
// To split around the first instance of a separator, see Cut.
278+
// To split around the first instance of a separator, see [Cut].
279279
func SplitN(s, sep string, n int) []string { return genSplit(s, sep, 0, n) }
280280

281281
// SplitAfterN slices s into substrings after each instance of sep and
@@ -304,7 +304,7 @@ func SplitAfterN(s, sep string, n int) []string {
304304
//
305305
// It is equivalent to [SplitN] with a count of -1.
306306
//
307-
// To split around the first instance of a separator, see Cut.
307+
// To split around the first instance of a separator, see [Cut].
308308
func Split(s, sep string) []string { return genSplit(s, sep, 0, -1) }
309309

310310
// SplitAfter slices s into all substrings after each instance of sep and
@@ -324,7 +324,7 @@ func SplitAfter(s, sep string) []string {
324324
var asciiSpace = [256]uint8{'\t': 1, '\n': 1, '\v': 1, '\f': 1, '\r': 1, ' ': 1}
325325

326326
// Fields splits the string s around each instance of one or more consecutive white space
327-
// characters, as defined by unicode.IsSpace, returning a slice of substrings of s or an
327+
// characters, as defined by [unicode.IsSpace], returning a slice of substrings of s or an
328328
// empty slice if s contains only white space.
329329
func Fields(s string) []string {
330330
// First count the fields.

0 commit comments

Comments
 (0)