MCPcopy Create free account
hub / github.com/segmentio/encoding / Valid

Function Valid

json/json.go:347–355  ·  view source on GitHub ↗

Valid is documented at https://golang.org/pkg/encoding/json/#Valid

(data []byte)

Source from the content-addressed store, hash-verified

345
346// Valid is documented at https://golang.org/pkg/encoding/json/#Valid
347func 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
358type Decoder struct {

Callers 3

TestValidFunction · 0.70
TestCodecFunction · 0.70
TestCodecDurationFunction · 0.70

Calls 3

parseValueMethod · 0.95
skipSpacesFunction · 0.85
internalParseFlagsFunction · 0.85

Tested by 3

TestValidFunction · 0.56
TestCodecFunction · 0.56
TestCodecDurationFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…