ParseJSON unmarshals a JSON byte slice into a *Container.
(sample []byte)
| 875 | |
| 876 | // ParseJSON unmarshals a JSON byte slice into a *Container. |
| 877 | func 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. |
| 888 | func ParseJSONDecoder(decoder *json.Decoder) (*Container, error) { |
no outgoing calls