have below json below docs = “Records” :[ “{“a”:“770959028”, “b”:“099898”, “c”:“load-generator-span”, “d”:{“random”:”",“randomtext”:"" }}\n", “{“a”:“770959028”, “b”:“099898”, “c”:“load-generator-span”, “d”:{“random”:”",“randomtext”:"" }}\n", “{“a”:“770959028”, “b”:“099898”, “c”:“load-generator-span”, “d”:{“random”:”",“randomtext”:"" }}\n", “{“a”:“770959028”, “b”:“099898”, “c”:“load-generator-span”, “d”:{“random”:”",“randomtext”:"" }}\n"]}
so I have unmarshall the above string using the json.Unmarshal([]byte(docs), &result) result is map like var result map[string]interface{}
now I can get the all the result[Records] but how can get the length of result[Records], the len function doesn’t work on this it gives me error like invalid argument for len. Is there any better function I can use.