x/model: some doc fixes
This commit is contained in:
parent
0172726a58
commit
81e8c49ac2
@ -300,7 +300,7 @@ var bufPool = sync.Pool{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalText implements encoding.TextMarshaler.
|
// MarshalText implements [encoding.TextMarshaler].
|
||||||
func (r Name) MarshalText() ([]byte, error) {
|
func (r Name) MarshalText() ([]byte, error) {
|
||||||
b := bufPool.Get().(*bytes.Buffer)
|
b := bufPool.Get().(*bytes.Buffer)
|
||||||
b.Reset()
|
b.Reset()
|
||||||
@ -315,7 +315,7 @@ func (r Name) MarshalText() ([]byte, error) {
|
|||||||
return b.Bytes(), nil
|
return b.Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalText implements encoding.TextUnmarshaler.
|
// UnmarshalText implements [encoding.TextUnmarshaler].
|
||||||
func (r *Name) UnmarshalText(text []byte) error {
|
func (r *Name) UnmarshalText(text []byte) error {
|
||||||
// unsafeString is safe here because the contract of UnmarshalText
|
// unsafeString is safe here because the contract of UnmarshalText
|
||||||
// that text belongs to us for the duration of the call.
|
// 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
|
// 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 {
|
func (r Name) Valid() bool {
|
||||||
// Parts ensures we only have valid parts, so no need to validate
|
// Parts ensures we only have valid parts, so no need to validate
|
||||||
// them here, only check if we have a name or not.
|
// them here, only check if we have a name or not.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user