DecodeUntaggedDurationValue decodes a value encoded by EncodeUntaggedDurationValue.
(b []byte)
| 2223 | |
| 2224 | // DecodeUntaggedDurationValue decodes a value encoded by EncodeUntaggedDurationValue. |
| 2225 | func DecodeUntaggedDurationValue(b []byte) (remaining []byte, d duration.Duration, err error) { |
| 2226 | var months, days, nanos int64 |
| 2227 | b, _, months, err = DecodeNonsortingStdlibVarint(b) |
| 2228 | if err != nil { |
| 2229 | return b, duration.Duration{}, err |
| 2230 | } |
| 2231 | b, _, days, err = DecodeNonsortingStdlibVarint(b) |
| 2232 | if err != nil { |
| 2233 | return b, duration.Duration{}, err |
| 2234 | } |
| 2235 | b, _, nanos, err = DecodeNonsortingStdlibVarint(b) |
| 2236 | if err != nil { |
| 2237 | return b, duration.Duration{}, err |
| 2238 | } |
| 2239 | return b, duration.DecodeDuration(months, days, nanos), nil |
| 2240 | } |
| 2241 | |
| 2242 | // DecodeBitArrayValue decodes a value encoded by EncodeUntaggedBitArrayValue. |
| 2243 | func DecodeBitArrayValue(b []byte) (remaining []byte, d bitarray.BitArray, err error) { |
no test coverage detected
searching dependent graphs…