============================================================================= Enhanced path-shape checker (catches nested D6 divergences) ============================================================================= containerIs reports whether data's first non-whitespace byte equals open. Used to ch
(data []byte, open byte)
| 998 | // containerIs reports whether data's first non-whitespace byte equals open. |
| 999 | // Used to check whether a JSON value is an object ('{') or array ('['). |
| 1000 | func containerIs(data []byte, open byte) bool { |
| 1001 | for _, b := range data { |
| 1002 | switch b { |
| 1003 | case ' ', '\t', '\n', '\r': |
| 1004 | continue |
| 1005 | case open: |
| 1006 | return true |
| 1007 | default: |
| 1008 | return false |
| 1009 | } |
| 1010 | } |
| 1011 | return false |
| 1012 | } |
| 1013 | |
| 1014 | // pathShapeMatchesData is a stricter version of pathShapeMatchesRoot that |
| 1015 | // also verifies container-type compatibility at EVERY nesting level, not |
no outgoing calls
no test coverage detected