EncodeDurationDescending is the descending version of EncodeDurationAscending.
(b []byte, d duration.Duration)
| 1523 | |
| 1524 | // EncodeDurationDescending is the descending version of EncodeDurationAscending. |
| 1525 | func EncodeDurationDescending(b []byte, d duration.Duration) ([]byte, error) { |
| 1526 | sortNanos, months, days, err := d.Encode() |
| 1527 | if err != nil { |
| 1528 | // TODO(dan): Handle this using d.EncodeBigInt() and the |
| 1529 | // durationBigNeg/durationBigPos markers. |
| 1530 | return b, err |
| 1531 | } |
| 1532 | b = append(b, durationMarker) |
| 1533 | b = EncodeVarintDescending(b, sortNanos) |
| 1534 | b = EncodeVarintDescending(b, months) |
| 1535 | b = EncodeVarintDescending(b, days) |
| 1536 | return b, nil |
| 1537 | } |
| 1538 | |
| 1539 | // DecodeDurationAscending decodes a duration.Duration value which was encoded |
| 1540 | // using EncodeDurationAscending. The remainder of the input buffer and the |
nothing calls this directly
no test coverage detected
searching dependent graphs…