moved definition of xim.ID.MarshalText() in the file, to put it in alphabetical order. (was too low)

master
Charles Iliya Krempeaux 2021-11-08 10:19:56 -08:00
parent cd717c34c5
commit 24be94455f
1 changed files with 11 additions and 11 deletions

22
id.go
View File

@ -71,6 +71,17 @@ func (receiver ID) Chaos() (uint64, bool) {
return value, true
}
// MarshalText makes xim.ID fit the encoding.TextMarshaler interface.
func (receiver ID) MarshalText() (text []byte, err error) {
if Nothing() == receiver {
return nil, errNothing
}
var serialized string = serialize(receiver.value)
return []byte(serialized), nil
}
// String makes xim.ID fit the fmt.Stringer interface.
//
// String also returns the serialized for of a xim-id, in xim-notation.
@ -84,17 +95,6 @@ func (receiver ID) String() string {
return serialized
}
// MarshalText makes xim.ID fit the encoding.TextMarshaler interface.
func (receiver ID) MarshalText() (text []byte, err error) {
if Nothing() == receiver {
return nil, errNothing
}
var serialized string = serialize(receiver.value)
return []byte(serialized), nil
}
// UnixTime returns the unixtime that is embeddd in the xim-id.
//
// Example usage: