Valid is documented at https://golang.org/pkg/encoding/json/#Valid
(data []byte)
| 345 | |
| 346 | // Valid is documented at https://golang.org/pkg/encoding/json/#Valid |
| 347 | func Valid(data []byte) bool { |
| 348 | data = skipSpaces(data) |
| 349 | d := decoder{flags: internalParseFlags(data)} |
| 350 | _, data, _, err := d.parseValue(data) |
| 351 | if err != nil { |
| 352 | return false |
| 353 | } |
| 354 | return len(skipSpaces(data)) == 0 |
| 355 | } |
| 356 | |
| 357 | // Decoder is documented at https://golang.org/pkg/encoding/json/#Decoder |
| 358 | type Decoder struct { |
searching dependent graphs…