rob05c commented on a change in pull request #1844: DeepCachingType -- "NEVER" 
is now default
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1844#discussion_r165562008
 
 

 ##########
 File path: lib/go-tc/enum.go
 ##########
 @@ -191,7 +191,7 @@ type DeepCachingType string
 const (
        DeepCachingTypeAlways  = DeepCachingType("ALWAYS")
        DeepCachingTypeNever   = DeepCachingType("NEVER")
-       DeepCachingTypeInvalid = DeepCachingType("")
+       DeepCachingTypeInvalid = DeepCachingType("INVALID")
 
 Review comment:
   Is this ever serialised to JSON, e.g. for the Client/Server? Might need
   `func (t *DeepCachingType) MarshalJSON() ([]byte, error) { return 
[]byte(t.String()), nil }` and to change `func (t DeepCachingType) String()` to 
`case DeepCachingTypeNever:
   return "NEVER"`, too.
   
   That will make everything but `string(t)` work (which should never be done). 
There's no perfect solution, but this is probably the safest, and is the only 
way to make `DeliveryService{}` default to Never.
   

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


With regards,
Apache Git Services

Reply via email to