MCPcopy
hub / github.com/cloudfoundry/cli / readJSONFile

Function readJSONFile

cf/util/json/json_parser.go:61–73  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

59}
60
61func readJSONFile(path string) ([]byte, error) {
62 file, err := os.Open(path)
63 if err != nil {
64 return nil, err
65 }
66
67 bytes, err := ioutil.ReadAll(file)
68 if err != nil {
69 return nil, err
70 }
71
72 return bytes, nil
73}
74
75func parseJSON(bytes []byte) (map[string]interface{}, error) {
76 stringMap := map[string]interface{}{}

Calls

no outgoing calls

Tested by

no test coverage detected