ocket8888 commented on a change in pull request #5922:
URL: https://github.com/apache/trafficcontrol/pull/5922#discussion_r652081126



##########
File path: lib/go-tc/deliveryservices.go
##########
@@ -192,18 +194,416 @@ type DeliveryServiceFieldsV31 struct {
 // DeliveryServiceV40 is a Delivery Service as it appears in version 4.0 of the
 // Traffic Ops API.
 type DeliveryServiceV40 struct {

Review comment:
       I was hoping #4996 would get added to the 6.x milestone, but it isn't so 
far. But still, I'd like to keep the timestamps as RFC3339, even if that would 
mean duplication.
   
   Unfortunately, I think mostly duplicated structs are just a fact of life 
with a versioned API in Go; even with the nesting of previous versions we have 
compatibility problems such that clients of the library are forbidden from 
constructing the objects with direct field initialization like
   ```go
   f := FooVX{
       Property: "value,
   }
   ```
   (which has broken in the past and will break in the future for as long as we 
use nesting, but I don't think that's widely known and so it's probably done in 
thousands of places outside of `lib/go-tc`)
   Using nesting saves code changes for non-breaking changes, but makes it 
harder to make breaking changes.
   
   If you want me to take out all the breaking structure changes I absolutely 
will, to be clear, since they aren't really necessary to accomplish the PR's 
goal. But then I intend to open a PR to re-introduce them, and I just hoped 
they could be small enough to fit into this, since I was touching the struct 
anyway.




-- 
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:
[email protected]


Reply via email to