You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
caused by: failed unmarshaling/decoding the response body: [{"id":"xxx-xxx-xxx-xxx-xxx","name":"xxx_1","type":"smartmachine","state":"running","image":"xxx-xxx-xxx-xxx","ips":["192.168.128.25"],"memory":128,"disk":3072,"metadata":{},"tags":{"sdc_docker":true},"created":"2015-06-25T22:14:01.462Z","updated":"2015-06-25T22:14:14.000Z","dataset":"xxx-xxx-xxx-xxx-xxx","primaryIp":"","firewall_enabled":true,"compute_node":"xxx-xxx-xxx-xxx","package":"t4-standard-128M"}]
caused by: json: cannot unmarshal array into Go value of type cloudapi.Machine
If I comment out the following section in the joyent/gocommon/http/client it works as expected:
func decodeStream(d *json.Decoder, into interface{}) error {
t := reflect.TypeOf(into)
if t.Kind() != reflect.Ptr || t.Elem().Kind() != reflect.Slice {
return fmt.Errorf("unexpected type %s", t)
}
// elemType := t.Elem().Elem()
// slice := reflect.ValueOf(into).Elem()
//
// for {
// val := reflect.New(elemType)
// if err := d.Decode(val.Interface()); err != nil {
//// fmt.Println(err)
// if err == io.EOF {
// break
// }
// return err
// }
// slice.Set(reflect.Append(slice, val.Elem()))
// }
return nil
}
The text was updated successfully, but these errors were encountered:
If I comment out the following section in the joyent/gocommon/http/client it works as expected:
The text was updated successfully, but these errors were encountered: