Skip to content

Commit d4bcfe4

Browse files
mvdangopherbot
authored andcommitted
regexp: fix copy-paste typo on Regexp.UnmarshalText doc
I noticed that https://go.dev/cl/479401 called both methods MarshalText in the godoc, so fix that. While here, add more godoc links for better usability. Change-Id: I8f10bafeca6a1ca1c1ed9be7a7dd9fdecfe991a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/484335 Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent 4bd20ec commit d4bcfe4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/regexp/regexp.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,18 +1284,18 @@ func (re *Regexp) Split(s string, n int) []string {
12841284
return strings
12851285
}
12861286

1287-
// MarshalText implements the encoding.TextMarshaler interface. The output
1287+
// MarshalText implements [encoding.TextMarshaler]. The output
12881288
// matches that of calling the [Regexp.String] method.
12891289
//
12901290
// Note that the output is lossy in some cases: This method does not indicate
1291-
// POSIX regular expressions (i.e. those compiled by calling CompilePOSIX), or
1291+
// POSIX regular expressions (i.e. those compiled by calling [CompilePOSIX]), or
12921292
// those for which the [Regexp.Longest] method has been called.
12931293
func (re *Regexp) MarshalText() ([]byte, error) {
12941294
return []byte(re.String()), nil
12951295
}
12961296

1297-
// MarshalText implements the encoding.TextUnmarshaler interface by calling
1298-
// Compile on the encoded value.
1297+
// UnmarshalText implements [encoding.TextUnmarshaler] by calling
1298+
// [Compile] on the encoded value.
12991299
func (re *Regexp) UnmarshalText(text []byte) error {
13001300
newRE, err := Compile(string(text))
13011301
if err != nil {

0 commit comments

Comments
 (0)