MCPcopy Index your code
hub / github.com/Jeffail/gabs / ParseJSON

Function ParseJSON

gabs.go:877–885  ·  view source on GitHub ↗

ParseJSON unmarshals a JSON byte slice into a *Container.

(sample []byte)

Source from the content-addressed store, hash-verified

875
876// ParseJSON unmarshals a JSON byte slice into a *Container.
877func ParseJSON(sample []byte) (*Container, error) {
878 var gabs Container
879
880 if err := json.Unmarshal(sample, &gabs.object); err != nil {
881 return nil, err
882 }
883
884 return &gabs, nil
885}
886
887// ParseJSONDecoder applies a json.Decoder to a *Container.
888func ParseJSONDecoder(decoder *json.Decoder) (*Container, error) {

Callers 15

ParseJSONFileFunction · 0.85
TestBasicFunction · 0.85
TestJSONPointerFunction · 0.85
TestDotPathFunction · 0.85
TestArrayWildcardFunction · 0.85
TestExistsFunction · 0.85
TestExistsWithArraysFunction · 0.85
TestDeletesFunction · 0.85
TestDeletesWithArraysFunction · 0.85
TestExamplesFunction · 0.85
TestSetAppendArrayFunction · 0.85
TestDotNotationFunction · 0.85

Calls

no outgoing calls

Tested by 15

TestBasicFunction · 0.68
TestJSONPointerFunction · 0.68
TestDotPathFunction · 0.68
TestArrayWildcardFunction · 0.68
TestExistsFunction · 0.68
TestExistsWithArraysFunction · 0.68
TestDeletesFunction · 0.68
TestDeletesWithArraysFunction · 0.68
TestExamplesFunction · 0.68
TestSetAppendArrayFunction · 0.68
TestDotNotationFunction · 0.68
TestModifyFunction · 0.68