diff --git a/src/net/netip/netip.go b/src/net/netip/netip.go
index 5a78820..e622799 100644
--- a/src/net/netip/netip.go
+++ b/src/net/netip/netip.go
@@ -95,9 +95,9 @@
}
}
-// AddrFrom16 returns the IPv6 address given by the bytes in addr.
-// An IPv4-mapped IPv6 address is left as an IPv6 address.
-// (Use Unmap to convert them if needed.)
+// AddrFrom16 returns the IPv6 address given by the bytes in addr. An
+// IPv4-mapped IPv6 address is left as an IPv6 address (use [Addr.Unmap] to
+// convert them if needed).
func AddrFrom16(addr [16]byte) Addr {
return Addr{
addr: uint128{
@@ -957,15 +957,15 @@
return string(ret)
}
-// AppendText implements the [encoding.TextAppender] interface,
-// It is the same as [Addr.AppendTo].
+// AppendText implements the [encoding.TextAppender] interface. The encoding is
+// the same as returned by [Addr.AppendTo].
func (ip Addr) AppendText(b []byte) ([]byte, error) {
return ip.AppendTo(b), nil
}
-// MarshalText implements the [encoding.TextMarshaler] interface,
-// The encoding is the same as returned by [Addr.String], with one exception:
-// If ip is the zero [Addr], the encoding is the empty string.
+// MarshalText implements the [encoding.TextMarshaler] interface. The encoding
+// is the same as returned by [Addr.String], with one exception: If ip is the
+// zero [Addr], the encoding is the empty string.
func (ip Addr) MarshalText() ([]byte, error) {
buf := []byte{}
switch ip.z {
@@ -985,7 +985,7 @@
return ip.AppendText(buf)
}
-// UnmarshalText implements the encoding.TextUnmarshaler interface.
+// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
// The IP address is expected in a form accepted by [ParseAddr].
//
// If text is empty, UnmarshalText sets *ip to the zero [Addr] and
@@ -1034,7 +1034,7 @@
}
// UnmarshalBinary implements the [encoding.BinaryUnmarshaler] interface.
-// It expects data in the form generated by MarshalBinary.
+// It expects data in the form generated by [Addr.MarshalBinary].
func (ip *Addr) UnmarshalBinary(b []byte) error {
n := len(b)
switch {
@@ -1201,15 +1201,15 @@
return b
}
-// AppendText implements the [encoding.TextAppender] interface. The
-// encoding is the same as returned by [AddrPort.AppendTo].
+// AppendText implements the [encoding.TextAppender] interface. The encoding is
+// the same as returned by [AddrPort.AppendTo].
func (p AddrPort) AppendText(b []byte) ([]byte, error) {
return p.AppendTo(b), nil
}
-// MarshalText implements the [encoding.TextMarshaler] interface. The
-// encoding is the same as returned by [AddrPort.String], with one exception: if
-// p.Addr() is the zero [Addr], the encoding is the empty string.
+// MarshalText implements the [encoding.TextMarshaler] interface. The encoding
+// is the same as returned by [AddrPort.String], with one exception: if p.Addr()
+// is the zero [Addr], the encoding is the empty string.
func (p AddrPort) MarshalText() ([]byte, error) {
buf := []byte{}
switch p.ip.z {
@@ -1224,9 +1224,9 @@
return p.AppendText(buf)
}
-// UnmarshalText implements the encoding.TextUnmarshaler
-// interface. The [AddrPort] is expected in a form
-// generated by [AddrPort.MarshalText] or accepted by [ParseAddrPort].
+// UnmarshalText implements the [encoding.TextUnmarshaler] interface. The
+// [AddrPort] is expected in a form generated by [AddrPort.MarshalText] or
+// accepted by [ParseAddrPort].
func (p *AddrPort) UnmarshalText(text []byte) error {
if len(text) == 0 {
*p = AddrPort{}
@@ -1513,9 +1513,9 @@
return p.AppendTo(b), nil
}
-// MarshalText implements the [encoding.TextMarshaler] interface,
-// The encoding is the same as returned by [Prefix.String], with one exception:
-// If p is the zero value, the encoding is the empty string.
+// MarshalText implements the [encoding.TextMarshaler] interface. The encoding
+// is the same as returned by [Prefix.String], with one exception: If p is the
+// zero [Prefix], the encoding is the empty string.
func (p Prefix) MarshalText() ([]byte, error) {
buf := []byte{}
switch p.ip.z {
@@ -1530,7 +1530,7 @@
return p.AppendText(buf)
}
-// UnmarshalText implements the encoding.TextUnmarshaler interface.
+// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
// The IP address is expected in a form accepted by [ParsePrefix]
// or generated by [Prefix.MarshalText].
func (p *Prefix) UnmarshalText(text []byte) error {
@@ -1543,7 +1543,7 @@
return err
}
-// AppendBinary implements the [encoding.AppendMarshaler] interface.
+// AppendBinary implements the [encoding.BinaryAppender] interface.
// It returns [Addr.AppendBinary] with an additional byte appended
// containing the prefix bits.
func (p Prefix) AppendBinary(b []byte) ([]byte, error) {