============================================================================= The fuzzer (testing.F, native go-fuzz) ============================================================================= looksLikeJSON reports whether data begins with a byte that could start a JSON value. This is a cheap pre-
(data []byte)
| 1478 | // or to regenerate from the grammar (to maintain structural coverage when |
| 1479 | // the engine has mutated the data into non-JSON garbage). |
| 1480 | func looksLikeJSON(data []byte) bool { |
| 1481 | for _, b := range data { |
| 1482 | switch b { |
| 1483 | case ' ', '\t', '\n', '\r': |
| 1484 | continue |
| 1485 | case '{', '[', '"', 't', 'f', 'n', '-', |
| 1486 | '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': |
| 1487 | return true |
| 1488 | default: |
| 1489 | return false |
| 1490 | } |
| 1491 | } |
| 1492 | return false |
| 1493 | } |
| 1494 | |
| 1495 | // FuzzJSONStructureAware is the structure-aware fuzzer. It combines: |
| 1496 | // - Grammar-based JSON generation (always emits valid structures). |
no outgoing calls
no test coverage detected