mirror of
https://github.com/safing/portbase
synced 2025-09-16 01:59:51 +00:00
Clean up accessor package, dedupe code
This commit is contained in:
parent
7ea7b5ed40
commit
3236ddf87f
4 changed files with 30 additions and 40 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue