EncodeDurationDescending is the descending version of EncodeDurationAscending.
(b []byte, d duration.Duration)
| 1040 | |
| 1041 | // EncodeDurationDescending is the descending version of EncodeDurationAscending. |
| 1042 | func EncodeDurationDescending(b []byte, d duration.Duration) ([]byte, error) { |
| 1043 | sortNanos, months, days, err := d.Encode() |
| 1044 | if err != nil { |
| 1045 | // TODO(dan): Handle this using d.EncodeBigInt() and the |
| 1046 | // durationBigNeg/durationBigPos markers. |
| 1047 | return b, err |
| 1048 | } |
| 1049 | b = append(b, durationMarker) |
| 1050 | b = EncodeVarintDescending(b, sortNanos) |
| 1051 | b = EncodeVarintDescending(b, months) |
| 1052 | b = EncodeVarintDescending(b, days) |
| 1053 | return b, nil |
| 1054 | } |
| 1055 | |
| 1056 | // DecodeDurationAscending decodes a duration.Duration value which was encoded |
| 1057 | // using EncodeDurationAscending. The remainder of the input buffer and the |
nothing calls this directly
no test coverage detected
searching dependent graphs…