rob05c commented on a change in pull request #1844: DeepCachingType -- "NEVER"
is now default
URL:
https://github.com/apache/incubator-trafficcontrol/pull/1844#discussion_r165555268
##########
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:
The default value of the enum should match the default value of the type,
i.e. `""`. So per
```
case "":
+ // default when omitted
+ return DeepCachingTypeNever
```
below, `DeepCachingTypeNever = DeepCachingType("NEVER")` should be
`DeepCachingTypeNever = DeepCachingType("")`
This will prevent errors if someone default-initializes a `DeepCachingType`,
e.g. `t := DeepCachingType{}` or `t := DeepCachingType("")` expecting it to be
the default for the enum.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services