From de6c4fe2eb8801a6882aecfc3046f68c3ff003c4 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 2 Aug 2019 11:28:01 -0700 Subject: [PATCH] getSingleImpl: don't check whether a map value is zero The code that checked whether a map value is zero was wrong. It passed the reflect.Value itself, which before Go 1.13 was never zero. In Go 1.13 this changed, as reflect.Value got an IsZero method, which reports whether the value stored in the reflect.Value is zero. Checking that causes tests in go-openapi/spec to fail. Fixes go-openapi/spec#99 Signed-off-by: Ian Lance Taylor --- pointer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pointer.go b/pointer.go index fe2d6ee..b284eb7 100644 --- a/pointer.go +++ b/pointer.go @@ -135,7 +135,7 @@ func getSingleImpl(node interface{}, decodedToken string, nameProvider *swag.Nam kv := reflect.ValueOf(decodedToken) mv := rValue.MapIndex(kv) - if mv.IsValid() && !swag.IsZero(mv) { + if mv.IsValid() { return mv.Interface(), kind, nil } return nil, kind, fmt.Errorf("object has no key %q", decodedToken)