code: func (prefs Preferences) CountFields(fieldName string) int {
  	value, err := reflections.GetField(prefs, fieldName)
  	count := 0
  	if err != nil {
  		return count
  	}
  	items, _ := reflections.Items(value)
  	for i := range items {
  		value, _ := reflections.GetField(value, i)
  		if value != nil && value != "" {
  			count++
  		}
  	}
  	return count
  }
docs: // CountFields returns the number of defined fields on sub-field struct