DecodeBoolValue decodes a value encoded by EncodeBoolValue.
(buf []byte)
| 2063 | |
| 2064 | // DecodeBoolValue decodes a value encoded by EncodeBoolValue. |
| 2065 | func DecodeBoolValue(buf []byte) (remaining []byte, b bool, err error) { |
| 2066 | _, dataOffset, _, typ, err := DecodeValueTag(buf) |
| 2067 | if err != nil { |
| 2068 | return buf, false, err |
| 2069 | } |
| 2070 | buf = buf[dataOffset:] |
| 2071 | switch typ { |
| 2072 | case True: |
| 2073 | return buf, true, nil |
| 2074 | case False: |
| 2075 | return buf, false, nil |
| 2076 | default: |
| 2077 | return buf, false, fmt.Errorf("value type is not %s or %s: %s", True, False, typ) |
| 2078 | } |
| 2079 | } |
| 2080 | |
| 2081 | // DecodeIntValue decodes a value encoded by EncodeIntValue. |
| 2082 | func DecodeIntValue(b []byte) (remaining []byte, i int64, err error) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…