// StringDefault reads string from config file with default value
189067
func (r *Reader) StringDefault(name string, def string) string {
	s, err := r.readString(name)
	if err != nil {
		return def
	}
	return s
}
1122056
func (s *DateArrayOptions) SetDefaultValue(v string) *DateArrayOptions {
	s.DefaultValue = &v
	return s
}
523820
func (s *FunctionDefinitionVersion) SetDefaultConfig(v *FunctionDefaultConfig) *FunctionDefinitionVersion {
	s.DefaultConfig = v
	return s
}
779006
func (r *Store) GetUint32Default(key string, def uint32) uint32 {
	if v, err := r.GetUint32(key); err == nil {
		return v
	}

	return def
}
47683
func (c *Config) ReadIntDefault(id string, defaultValue int) int {
	val, err := c.ReadInt(id)
	if err != nil {
		return defaultValue
	}
	return val
}
839510
func GetDefaultCollation(charset string) (string, error) {
	charset = strings.ToLower(charset)
	if charset == CharsetBin {
		return CollationBin, nil
	}
	c, ok := charsets[charset]
	if !ok {
		return "", errors.Errorf("Unknown charset %s", charset)
	}
	return c.DefaultCollation.Name, nil
}
175311
func DefaultConfig() Config {
	return Config{
		Filters:        make(map[string]FilterFunction),
		Globals:        make(map[string]interface{}, 0),
		DebugTemplates: false,
	}
}
244185
func EnvOrDefault(envName, defaultVal string) string {
	if e := os.Getenv(envName); e != "" {
		return e
	}
	return defaultVal
}
120889
func NewDefaultConfig() Config {
	return Config{
		URL:             "http://127.0.0.1:8080",
		EventsTransport: EventsTransportCallback,
		EventsPort:      10001,
		EventsInterface: "eth0",
		LogOutput:       ioutil.Discard,
		PollingWaitTime: defaultPollingWaitTime,
	}
}
1339770
func (l *LabelResult) GetDefault() bool {
	if l == nil || l.Default == nil {
		return false
	}
	return *l.Default
}
130670
func ConfigDefaults(providerDefaults schema.Defaults) schema.Defaults {
	defaults := schema.Defaults{
		JujuApplicationPath: JujuDefaultApplicationPath,
	}
	for key, value := range providerDefaults {
		if value == schema.Omit {
			continue
		}
		defaults[key] = value
	}
	return defaults
}
433955
func (l *Label) GetDefault() bool {
	if l == nil || l.Default == nil {
		return false
	}
	return *l.Default
}
543223
func (r *Reader) BytesDefault(name string, def []byte) []byte {
	b, err := r.r.Read(name)
	if err != nil {
		return def
	}
	return b
}
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)
	}
}
803287
func (s *PolicyAttributeTypeDescription) SetDefaultValue(v string) *PolicyAttributeTypeDescription {
	s.DefaultValue = &v
	return s
}
843156
func (i Isolation) IsDefault() bool {
	return strings.ToLower(string(i)) == "default" || string(i) == ""
}
1279420
func GetStringFieldWithDefault(r *http.Request, fieldName, defaultValue string) string {
	if fieldValue, err := GetStringField(r, fieldName); err == nil {
		return fieldValue
	}
	return defaultValue
}