diff options
| author | Daniel Martí <mvdan@mvdan.cc> | 2023-07-07 11:06:05 +0200 |
|---|---|---|
| committer | Daniel Martí <mvdan@mvdan.cc> | 2023-08-07 06:58:18 +0000 |
| commit | 088f953fd0e5aa99a9e4a92acdb9a6058480491c (patch) | |
| tree | e400245892a39bf5a6bbe59375b2238f1442e92e /src/encoding/json/encode.go | |
| parent | ea565f156b6c789cab058437f902950bd98e1b7f (diff) | |
| download | go-088f953fd0e5aa99a9e4a92acdb9a6058480491c.tar.xz | |
all: add a few more godoc links
Over the past few months as I read the standard library's documentation
I kept finding spots where godoc links would have helped me.
I kept adding to a stash of changes to fix them up bit by bit.
The stash has grown big enough by now, and we're nearing a release,
so I think it's time to merge to avoid git conflicts or bit rot.
Note that a few sentences are slightly reworded,
since "implements the Fooer interface" can just be "implements [Fooer]"
now that the link provides all the context needed to the user.
Change-Id: I01c31d3d3ff066d06aeb44f545f8dd0fb9a8d998
Reviewed-on: https://go-review.googlesource.com/c/go/+/508395
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/encoding/json/encode.go')
| -rw-r--r-- | src/encoding/json/encode.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go index 4669a02e2e..a98f1a060c 100644 --- a/src/encoding/json/encode.go +++ b/src/encoding/json/encode.go @@ -28,14 +28,14 @@ import ( // Marshal returns the JSON encoding of v. // // Marshal traverses the value v recursively. -// If an encountered value implements the Marshaler interface -// and is not a nil pointer, Marshal calls its MarshalJSON method -// to produce JSON. If no MarshalJSON method is present but the -// value implements encoding.TextMarshaler instead, Marshal calls -// its MarshalText method and encodes the result as a JSON string. +// If an encountered value implements [Marshaler] +// and is not a nil pointer, Marshal calls [Marshaler.MarshalJSON] +// to produce JSON. If no [Marshaler.MarshalJSON] method is present but the +// value implements [encoding.TextMarshaler] instead, Marshal calls +// [encoding.TextMarshaler.MarshalText] and encodes the result as a JSON string. // The nil pointer exception is not strictly necessary // but mimics a similar, necessary exception in the behavior of -// UnmarshalJSON. +// [Unmarshaler.UnmarshalJSON]. // // Otherwise, Marshal uses the following type-dependent default encodings: // |
