From fc77ba6355f62741909f471546e326009e2bafbd Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Wed, 14 Jan 2015 17:54:01 -0800 Subject: [PATCH] validate: allow promotion of int to float64 --- config/validate/rules.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/validate/rules.go b/config/validate/rules.go index 6da2772..e1e6ad5 100644 --- a/config/validate/rules.go +++ b/config/validate/rules.go @@ -107,7 +107,9 @@ func isCompatible(n, g reflect.Kind) bool { return n == reflect.String || n == reflect.Int || n == reflect.Float64 || n == reflect.Bool case reflect.Struct: return n == reflect.Struct || n == reflect.Map - case reflect.Bool, reflect.Slice, reflect.Int, reflect.Float64: + case reflect.Float64: + return n == reflect.Float64 || n == reflect.Int + case reflect.Bool, reflect.Slice, reflect.Int: return n == g default: panic(fmt.Sprintf("isCompatible(): unhandled kind %s", g))