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
package prefs
import (
	"os"
	"reflect"
	"strings"
	"github.com/manifoldco/torus-cli/errs"
	"github.com/go-ini/ini"
	"gopkg.in/oleiade/reflections.v1"
)
const (
	rcFilename        = ".torusrc"
	registryURI       = "https://registry.arigato.sh"
	manifestURI       = "https://get.torus.sh/manifest.json"
	gatekeeperAddress = "0.0.0.0:8200"
)
type Preferences struct {
	Core     Core     `ini:"core"`
	Defaults Defaults `ini:"defaults"`
}