You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2018/07/17 22:16:12 UTC
[trafficcontrol] 02/02: fix deepcaching enum validation check
This is an automated email from the ASF dual-hosted git repository.
dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit e566efedd2b5cda9b9d9e44acfc6a247177a2b54
Author: Dan Kirkwood <da...@apache.org>
AuthorDate: Tue Jul 17 16:04:08 2018 -0600
fix deepcaching enum validation check
---
lib/go-tc/enum_test.go | 2 +-
lib/go-tc/tovalidate/rules.go | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/go-tc/enum_test.go b/lib/go-tc/enum_test.go
index 95fb64a..a06e0b1 100644
--- a/lib/go-tc/enum_test.go
+++ b/lib/go-tc/enum_test.go
@@ -62,7 +62,7 @@ func TestDeepCachingType(t *testing.T) {
}
// make sure we get the right default when marshalled within a new delivery service
- var ds DeliveryService
+ var ds DeliveryServiceV13
_, err := json.MarshalIndent(ds, ``, ` `)
if err != nil {
t.Errorf(err.Error())
diff --git a/lib/go-tc/tovalidate/rules.go b/lib/go-tc/tovalidate/rules.go
index 1e86407..940424c 100644
--- a/lib/go-tc/tovalidate/rules.go
+++ b/lib/go-tc/tovalidate/rules.go
@@ -46,7 +46,9 @@ func IsOneOfStringICase(set ...string) func(string) bool {
for _, s := range set {
lowcased = append(lowcased, strings.ToLower(s))
}
- return IsOneOfString(lowcased...)
+ return func(s string) bool {
+ return IsOneOfString(lowcased...)(strings.ToLower(s))
+ }
}
func IsGreaterThanZero(value interface{}) error {