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
}
// CountFields returns the number of defined fields on sub-field struct
CountFields returns the number of defined fields on sub-field struct
// CountFields returns the number of defined fields on sub - field struct
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
}
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 }
CountFields returns the number of defined fields on sub-field struct
CountFields returns the number of defined fields on sub - field struct