From dac9b9ddbd5160c5f4552410f5f8281bd5eed38c Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Fri, 1 Sep 2023 01:54:25 -0700 Subject: encoding: modernize Go documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Across all encoding packages, linkify declarations if possible. In some cases, we convert a code block into a bulleted list, which then further allows for more linkification. Change-Id: I68fedf362615b34228bab5d4859b7d87d831c570 Reviewed-on: https://go-review.googlesource.com/c/go/+/524977 LUCI-TryBot-Result: Go LUCI Reviewed-by: Daniel Martí Reviewed-by: Ian Lance Taylor Reviewed-by: qiulaidongfeng <2645477756@qq.com> Reviewed-by: Matthew Dempsky --- src/encoding/gob/decoder.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/encoding/gob/decoder.go') diff --git a/src/encoding/gob/decoder.go b/src/encoding/gob/decoder.go index 5b77adc7e8..c4b6088013 100644 --- a/src/encoding/gob/decoder.go +++ b/src/encoding/gob/decoder.go @@ -37,9 +37,9 @@ type Decoder struct { err error } -// NewDecoder returns a new decoder that reads from the io.Reader. -// If r does not also implement io.ByteReader, it will be wrapped in a -// bufio.Reader. +// NewDecoder returns a new decoder that reads from the [io.Reader]. +// If r does not also implement [io.ByteReader], it will be wrapped in a +// [bufio.Reader]. func NewDecoder(r io.Reader) *Decoder { dec := new(Decoder) // We use the ability to read bytes as a plausible surrogate for buffering. @@ -188,7 +188,7 @@ func (dec *Decoder) decodeTypeSequence(isInterface bool) typeId { // If e is nil, the value will be discarded. Otherwise, // the value underlying e must be a pointer to the // correct type for the next data item received. -// If the input is at EOF, Decode returns io.EOF and +// If the input is at EOF, Decode returns [io.EOF] and // does not modify e. func (dec *Decoder) Decode(e any) error { if e == nil { @@ -208,7 +208,7 @@ func (dec *Decoder) Decode(e any) error { // If v is the zero reflect.Value (v.Kind() == Invalid), DecodeValue discards the value. // Otherwise, it stores the value into v. In that case, v must represent // a non-nil pointer to data or be an assignable reflect.Value (v.CanSet()) -// If the input is at EOF, DecodeValue returns io.EOF and +// If the input is at EOF, DecodeValue returns [io.EOF] and // does not modify v. func (dec *Decoder) DecodeValue(v reflect.Value) error { if v.IsValid() { -- cgit v1.3-5-g9baa