Clean up accessor package, dedupe code

This commit is contained in:
Daniel 2019-09-20 10:36:55 +02:00
parent 7ea7b5ed40
commit 3236ddf87f
4 changed files with 30 additions and 40 deletions

View file

@ -160,10 +160,7 @@ func (sa *StructAccessor) GetBool(key string) (value bool, ok bool) {
// Exists returns the whether the given key exists.
func (sa *StructAccessor) Exists(key string) bool {
field := sa.object.FieldByName(key)
if field.IsValid() {
return true
}
return false
return field.IsValid()
}
// Type returns the accessor type as a string.