I get the error "cannot unmarshal object into Go value of type []main.parsed" when I try this
package main
import {...}
type parsed struct {
Title string `json:"title,string,omitempty"`
}
func Function (args [] String) string {
var jsonData [] parsed
body, err := ioutil.ReadAll(resp.Body)
if err!= nil {
return ""
}
err = json.Unmarshal([]byte(body), &jsonData)
if err!= nil {
return ""
}
fmt.Println(jsonData)
}