From e0c26f770f5e2aad5e883dd51dbc5f6528282751 Mon Sep 17 00:00:00 2001 From: Nikita Tokarchuk Date: Sat, 14 Mar 2020 19:34:37 +0100 Subject: [PATCH] Do not find through unexported values --- mongox/base/getprotection.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mongox/base/getprotection.go b/mongox/base/getprotection.go index 12ca266..1a51479 100644 --- a/mongox/base/getprotection.go +++ b/mongox/base/getprotection.go @@ -19,6 +19,9 @@ func GetProtection(source interface{}) *protection.Key { for i := 0; i < numField; i++ { field := el.Field(i) + if !field.CanInterface() { + continue + } switch field.Interface().(type) { case *protection.Key: