DecodeBoolValue decodes a value encoded by EncodeBoolValue.
(buf []byte)
| 2895 | |
| 2896 | // DecodeBoolValue decodes a value encoded by EncodeBoolValue. |
| 2897 | func DecodeBoolValue(buf []byte) (remaining []byte, b bool, err error) { |
| 2898 | _, dataOffset, _, typ, err := DecodeValueTag(buf) |
| 2899 | if err != nil { |
| 2900 | return buf, false, err |
| 2901 | } |
| 2902 | buf = buf[dataOffset:] |
| 2903 | switch typ { |
| 2904 | case True: |
| 2905 | return buf, true, nil |
| 2906 | case False: |
| 2907 | return buf, false, nil |
| 2908 | default: |
| 2909 | return buf, false, fmt.Errorf("value type is not %s or %s: %s", True, False, typ) |
| 2910 | } |
| 2911 | } |
| 2912 | |
| 2913 | // DecodeIntValue decodes a value encoded by EncodeIntValue. |
| 2914 | func DecodeIntValue(b []byte) (remaining []byte, i int64, err error) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…