(b []byte, expected Type)
| 3190 | } |
| 3191 | |
| 3192 | func decodeValueTypeAssert(b []byte, expected Type) ([]byte, error) { |
| 3193 | _, dataOffset, _, typ, err := DecodeValueTag(b) |
| 3194 | if err != nil { |
| 3195 | return b, err |
| 3196 | } |
| 3197 | b = b[dataOffset:] |
| 3198 | if typ != expected { |
| 3199 | return b, errors.Errorf("value type is not %s: %s", expected, typ) |
| 3200 | } |
| 3201 | return b, nil |
| 3202 | } |
| 3203 | |
| 3204 | // PeekValueLength returns the length of the encoded value at the start of b. |
| 3205 | // Note: If this function succeeds, it's not a guarantee that decoding the value |
no test coverage detected
searching dependent graphs…