func NewPreferences(useDefaults bool) (*Preferences, error) {
	prefs := &Preferences{}
	if useDefaults {
		prefs = &Preferences{
			Core: Core{
				RegistryURI: registryURI,
				Context:     true,
			},
		}
	}

	filePath, _ := RcPath()
	_, err := os.Stat(filePath)
	if os.IsNotExist(err) {
		return prefs, nil
	}

	if err != nil {
		return nil, err
	}

	rcPath, _ := RcPath()
	err = ini.MapTo(prefs, rcPath)
	if err != nil {
		return nil, err
	}

	return prefs, nil
}
// NewPreferences returns a new instance of preferences struct
NewPreferences returns a new instance of preferences struct
// NewPreferences returns a new instance of preferences struct
func NewPreferences(useDefaults bool) (*Preferences, error) {
	prefs := &Preferences{}
	if useDefaults {
		prefs = &Preferences{
			Core: Core{
				RegistryURI: registryURI,
				Context:     true,
			},
		}
	}
	filePath, _ := RcPath()
	_, err := os.Stat(filePath)
	if os.IsNotExist(err) {
		return prefs, nil
	}
	if err != nil {
		return nil, err
	}
	rcPath, _ := RcPath()
	err = ini.MapTo(prefs, rcPath)
	if err != nil {
		return nil, err
	}
	return prefs, nil
}
func NewPreferences ( useDefaults bool ) ( * Preferences , error ) { prefs := & Preferences { } if useDefaults { prefs = & Preferences { Core : Core { RegistryURI : registryURI , Context : true , } , } } filePath , _ := RcPath ( ) _ , err := os . Stat ( filePath ) if os . IsNotExist ( err ) { return prefs , nil } if err != nil { return nil , err } rcPath , _ := RcPath ( ) err = ini . MapTo ( prefs , rcPath ) if err != nil { return nil , err } return prefs , nil }
NewPreferences returns a new instance of preferences struct
NewPreferences returns a new instance of preferences struct