Prev returns the previous valid XID at the same time – it simply returns a new XID with the previous sequence number.
()
| 84 | |
| 85 | // Prev returns the previous valid XID at the same time – it simply returns a new XID with the previous sequence number. |
| 86 | func (xid XID) Prev() XID { |
| 87 | if xid.Seq() <= 1 { |
| 88 | return xid |
| 89 | } |
| 90 | |
| 91 | return NewXID(xid.Time(), xid.Seq()-1) |
| 92 | } |
| 93 | |
| 94 | // Time returns the time represented by this XID, accurate to one second. |
| 95 | func (xid XID) Time() time.Time { |