You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/03/14 14:59:55 UTC

[GitHub] [trafficcontrol] moltzaum edited a comment on issue #3394: Fix interface ptr problem

moltzaum edited a comment on issue #3394: Fix interface ptr problem
URL: https://github.com/apache/trafficcontrol/pull/3394#issuecomment-472145850
 
 
   I don't think it does. For each CRUD operation the struct is zeroed out, which should functionally be equivalent to returning a new object.
   
   I think the struct scan requires every field is a destination, so the TOType that is passed wouldn't work. Because the `GenericReader` is defined on an interface, you also can't use the dot operator to get the embedded struct.
   
   api/crud.go:103
   ```
   v := val.NewReadObj()
   if err = rows.StructScan(v); err != nil {
     return nil, nil, errors.New("scanning " + val.GetType() + ": " + err.Error()), http.StatusInternalServerError
   }
   vals = append(vals, v)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services