x/model: some doc fixes

This commit is contained in:
Blake Mizerany 2024-04-06 16:58:10 -07:00
parent 0172726a58
commit 81e8c49ac2

View File

@ -300,7 +300,7 @@ var bufPool = sync.Pool{
},
}
// MarshalText implements encoding.TextMarshaler.
// MarshalText implements [encoding.TextMarshaler].
func (r Name) MarshalText() ([]byte, error) {
b := bufPool.Get().(*bytes.Buffer)
b.Reset()
@ -315,7 +315,7 @@ func (r Name) MarshalText() ([]byte, error) {
return b.Bytes(), nil
}
// UnmarshalText implements encoding.TextUnmarshaler.
// UnmarshalText implements [encoding.TextUnmarshaler].
func (r *Name) UnmarshalText(text []byte) error {
// unsafeString is safe here because the contract of UnmarshalText
// that text belongs to us for the duration of the call.
@ -465,7 +465,7 @@ func NameParts(s string) iter.Seq2[NamePart, string] {
}
// Valid returns true if the Name has a valid nick. To know if a Name is
// "complete", use Complete.
// "complete", use [Name.Complete].
func (r Name) Valid() bool {
// Parts ensures we only have valid parts, so no need to validate
// them here, only check if we have a name or not.