// BasicDefault is a wrapper around Terminal.BasicDefault.
966652
func BasicDefault(prefix, def string) (string, error) {
	term, err := NewTerminal()
	if err != nil {
		return "", err
	}
	defer term.Close()

	return term.BasicDefault(prefix, def)
}
1349457
func (e Entry) Int64Default(def int64) (int64, error) {
	v := e.ValueRaw
	if v == nil {
		return def, errFindParse.Format("int64", e.Key)
	}

	switch vv := v.(type) {
	case string:
		return strconv.ParseInt(vv, 10, 64)
	case int64:
		return vv, nil
	case int32:
		return int64(vv), nil
	case int8:
		return int64(vv), nil
	case int:
		return int64(vv), nil
	}

	return def, errFindParse.Format("int64", e.Key)
}
843156
func (i Isolation) IsDefault() bool {
	return strings.ToLower(string(i)) == "default" || string(i) == ""
}
117879
func (r *Reader) IntDefault(name string, def int) int {
	i, err := r.readInt(name)
	if err != nil {
		return def
	}
	return i
}
211303
func softDefault(substitution string, mapping Mapping) (string, bool, error) {
	sep := ":-"
	if !strings.Contains(substitution, sep) {
		return "", false, nil
	}
	name, defaultValue := partition(substitution, sep)
	value, ok := mapping(name)
	if !ok || value == "" {
		return defaultValue, true, nil
	}
	return value, true, nil
}
578158
func (b *BoolRule) Default() ctypes.ConfigValue {
	if b.default_ != nil {
		return ctypes.ConfigValueBool{Value: *b.default_}
	}
	return nil
}
243663
func PrintDefaults() {
	fmt.Fprintln(errorWriter, "The commands are:")
	for _, c := range subcommands {
		if c.Name == defaultSubcommand.Name {
			fmt.Fprintf(errorWriter, "   [%s] - %s (*default)\n", c.Name, c.Description)
		} else {
			fmt.Fprintf(errorWriter, "   %s - %s\n", c.Name, c.Description)
		}
	}
}
512761
func ArgDefault(args []string, n int, def string) string {
	if len(args) <= n {
		return def
	}
	return args[n]
}
1013452
func (e Entry) IntDefault(def int) (int, error) {
	v := e.ValueRaw
	if v == nil {
		return def, errFindParse.Format("int", e.Key)
	}

	switch vv := v.(type) {
	case string:
		val, err := strconv.Atoi(vv)
		if err != nil {
			return def, err
		}
		return val, nil
	case int:
		return vv, nil
	case int8:
		return int(vv), nil
	case int16:
		return int(vv), nil
	case int32:
		return int(vv), nil
	case int64:
		return int(vv), nil
	case uint:
		return int(vv), nil
	case uint8:
		return int(vv), nil
	case uint16:
		return int(vv), nil
	case uint32:
		return int(vv), nil
	case uint64:
		return int(vv), nil
	}

	return def, errFindParse.Format("int", e.Key)
}
865679
func (m ModuleInstance) ProviderConfigDefault(name string) AbsProviderConfig {
	return AbsProviderConfig{
		Module: m,
		ProviderConfig: ProviderConfig{
			Type: name,
		},
	}
}
949775
func (ctx *context) PostValueIntDefault(name string, def int) int {
	if v, err := ctx.PostValueInt(name); err == nil {
		return v
	}

	return def
}
779006
func (r *Store) GetUint32Default(key string, def uint32) uint32 {
	if v, err := r.GetUint32(key); err == nil {
		return v
	}

	return def
}
988459
func (s *StringRule) Default() ctypes.ConfigValue {
	if s.default_ != nil {
		return ctypes.ConfigValueStr{Value: *s.default_}
	}
	return nil
}
189067
func (r *Reader) StringDefault(name string, def string) string {
	s, err := r.readString(name)
	if err != nil {
		return def
	}
	return s
}
57261
func (a *AttributeDefinition) SetDefault(def interface{}) {
	switch actual := def.(type) {
	case HashVal:
		a.DefaultValue = actual.ToMap()
	case ArrayVal:
		a.DefaultValue = actual.ToSlice()
	default:
		a.DefaultValue = actual
	}
}
927885
func (i *UI) setDefault() {
	// Set the default writer & reader if not provided
	if i.Writer == nil {
		i.Writer = defaultWriter
	}

	if i.Reader == nil {
		i.Reader = defaultReader
	}

	if i.bReader == nil {
		i.bReader = bufio.NewReader(i.Reader)
	}
}
499631
func NewDefault() (c *Config, err error) {
	c = &Config{}
	err = c.LoadDefaultConfig()
	if err != nil {
		c = nil
		return
	}
	return
}