ReadDurationBytes tries to read a time.Duration from 'b' and return the value and the remaining bytes. Possible errors: - [ErrShortBytes] (too few bytes) - TypeError (not a int)
(b []byte)
| 410 | // - [ErrShortBytes] (too few bytes) |
| 411 | // - TypeError (not a int) |
| 412 | func ReadDurationBytes(b []byte) (d time.Duration, o []byte, err error) { |
| 413 | i, o, err := ReadInt64Bytes(b) |
| 414 | return time.Duration(i), o, err |
| 415 | } |
| 416 | |
| 417 | // ReadInt64Bytes tries to read an int64 |
| 418 | // from 'b' and return the value and the remaining bytes. |
searching dependent graphs…