From 9a8621cea1ac7ae0b66f912890cdae1b66f9587f Mon Sep 17 00:00:00 2001 From: Martin Karlsch Date: Thu, 18 Sep 2014 12:22:44 +0200 Subject: [PATCH] skip unexported fields for bindings --- binding/binding.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/binding/binding.go b/binding/binding.go index 61a57b14..27c73dcd 100644 --- a/binding/binding.go +++ b/binding/binding.go @@ -174,6 +174,11 @@ func Validate(obj interface{}) error { continue } + // skip unexported fields + if field.PkgPath != "" { + continue + } + fieldValue := val.Field(i).Interface() zero := reflect.Zero(field.Type).Interface()