(b []byte, expected Type)
| 2306 | } |
| 2307 | |
| 2308 | func decodeValueTypeAssert(b []byte, expected Type) ([]byte, error) { |
| 2309 | _, dataOffset, _, typ, err := DecodeValueTag(b) |
| 2310 | if err != nil { |
| 2311 | return b, err |
| 2312 | } |
| 2313 | b = b[dataOffset:] |
| 2314 | if typ != expected { |
| 2315 | return b, errors.Errorf("value type is not %s: %s", expected, typ) |
| 2316 | } |
| 2317 | return b, nil |
| 2318 | } |
| 2319 | |
| 2320 | // PeekValueLength returns the length of the encoded value at the start of b. |
| 2321 | // Note: If this function succeeds, it's not a guarantee that decoding the value |
no test coverage detected
searching dependent graphs…