From 24be94455f34dfa8610fc39b27e5ba85da2bed9a Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Mon, 8 Nov 2021 10:19:56 -0800 Subject: [PATCH] moved definition of xim.ID.MarshalText() in the file, to put it in alphabetical order. (was too low) --- id.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/id.go b/id.go index 9730f1f..24354be 100644 --- a/id.go +++ b/id.go @@ -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 unix‐time that is embeddd in the xim-id. // // Example usage: