moved definition of xim.ID.MarshalText() in the file, to put it in alphabetical order. (was too low)
parent
cd717c34c5
commit
24be94455f
22
id.go
22
id.go
|
@ -71,6 +71,17 @@ func (receiver ID) Chaos() (uint64, bool) {
|
||||||
return value, true
|
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 makes xim.ID fit the fmt.Stringer interface.
|
||||||
//
|
//
|
||||||
// String also returns the serialized for of a xim-id, in xim-notation.
|
// String also returns the serialized for of a xim-id, in xim-notation.
|
||||||
|
@ -84,17 +95,6 @@ func (receiver ID) String() string {
|
||||||
return serialized
|
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 unix‐time that is embeddd in the xim-id.
|
// UnixTime returns the unix‐time that is embeddd in the xim-id.
|
||||||
//
|
//
|
||||||
// Example usage:
|
// Example usage:
|
||||||
|
|
Loading…
Reference in New Issue