// WithDefaults sets the defaults for a golang build and returns it
434392
func (*Builder) WithDefaults(build config.Build) config.Build {
	if build.Main == "" {
		build.Main = "."
	}
	if len(build.Goos) == 0 {
		build.Goos = []string{"linux", "darwin"}
	}
	if len(build.Goarch) == 0 {
		build.Goarch = []string{"amd64", "386"}
	}
	if len(build.Goarm) == 0 {
		build.Goarm = []string{"6"}
	}
	if len(build.Ldflags) == 0 {
		build.Ldflags = []string{"-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"}
	}
	if len(build.Targets) == 0 {
		build.Targets = matrix(build)
	}
	return build
}
327961
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&Cluster{}, func(obj interface{}) { SetObjectDefaults_Cluster(obj.(*Cluster)) })
	scheme.AddTypeDefaultingFunc(&ClusterList{}, func(obj interface{}) { SetObjectDefaults_ClusterList(obj.(*ClusterList)) })
	return nil
}
392577
func NewDefaults() (*args.GeneratorArgs, *CustomArgs) {
	genericArgs := args.Default().WithoutDefaultFlagParsing()
	customArgs := &CustomArgs{}
	genericArgs.CustomArgs = (*generators.CustomArgs)(customArgs) // convert to upstream type to make type-casts work there
	genericArgs.OutputFileBaseName = "deepcopy_generated"
	return genericArgs, customArgs
}
306996
func NewDefaultConfig() *Config {
	return (&Config{}).WithOptions(
		SnapshotSubdirectory(".snapshots"),
		EnvVariableName("UPDATE_SNAPSHOTS"),
		FailOnUpdate(true),
		CreateNewAutomatically(true),
		FatalOnMismatch(false),
		SnapshotFileExtension(""),
	)
}
499631
func NewDefault() (c *Config, err error) {
	c = &Config{}
	err = c.LoadDefaultConfig()
	if err != nil {
		c = nil
		return
	}
	return
}
1198884
func WithStreamingDefaults() Option {
	return func(c *config) {
		c.tcpKeepAliveTimeout = 30 * time.Second
		c.disableKeepAlives = false
		c.requestTimeout = 0
	}
}
532881
func (c *ConfigDataNode) ApplyDefaults(defaults map[string]ctypes.ConfigValue) {
	// Lock here since we are modifying c.table
	c.mutex.Lock()
	defer c.mutex.Unlock()
	for name, def := range defaults {
		if _, ok := c.table[name]; !ok {
			c.table[name] = def
		}
	}
}
298855
func (c *ConfigPolicy) getDefaults() Config {
	config := NewConfig()
	for _, v := range c.stringRules {
		for key, val := range v.Rules {
			if val.HasDefault {
				config[key] = val.Default
			}
		}
	}
	for _, v := range c.boolRules {
		for key, val := range v.Rules {
			if val.HasDefault {
				config[key] = val.Default
			}
		}
	}
	for _, v := range c.floatRules {
		for key, val := range v.Rules {
			if val.HasDefault {
				config[key] = val.Default
			}
		}
	}
	for _, v := range c.integerRules {
		for key, val := range v.Rules {
			if val.HasDefault {
				config[key] = val.Default
			}
		}
	}

	return config
}
413761
func (o *Options) ApplyDefaults(in *kubeproxyconfig.KubeProxyConfiguration) (*kubeproxyconfig.KubeProxyConfiguration, error) {
	external, err := o.scheme.ConvertToVersion(in, v1alpha1.SchemeGroupVersion)
	if err != nil {
		return nil, err
	}

	o.scheme.Default(external)

	internal, err := o.scheme.ConvertToVersion(external, kubeproxyconfig.SchemeGroupVersion)
	if err != nil {
		return nil, err
	}

	out := internal.(*kubeproxyconfig.KubeProxyConfiguration)

	return out, nil
}
717289
func (r QueryRequest) WithDefaults() QueryRequest {
	if r.Type == "" {
		r.Type = "flux"
	}
	if r.Dialect.Delimiter == "" {
		r.Dialect.Delimiter = ","
	}
	if r.Dialect.DateTimeFormat == "" {
		r.Dialect.DateTimeFormat = "RFC3339"
	}
	if r.Dialect.Header == nil {
		header := true
		r.Dialect.Header = &header
	}
	return r
}
735585
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&Flunder{}, func(obj interface{}) { SetObjectDefaults_Flunder(obj.(*Flunder)) })
	scheme.AddTypeDefaultingFunc(&FlunderList{}, func(obj interface{}) { SetObjectDefaults_FlunderList(obj.(*FlunderList)) })
	return nil
}
39123
func GetWithDefault(ctx context.Context, def types.Target) types.Target {
	if t := Get(ctx); t != nil {
		return t
	}
	return def
}
1313169
func WithDefaultProfile() oci.SpecOpts {
	return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
		s.Linux.Seccomp = DefaultProfile(s)
		return nil
	}
}
1247718
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1.Route{}, func(obj interface{}) { SetObjectDefaults_Route(obj.(*v1.Route)) })
	scheme.AddTypeDefaultingFunc(&v1.RouteList{}, func(obj interface{}) { SetObjectDefaults_RouteList(obj.(*v1.RouteList)) })
	return nil
}
51757
func (r *Route) SetDefaults() {
	if r.Memory == 0 {
		r.Memory = 128
	}

	if r.Type == TypeNone {
		r.Type = TypeSync
	}

	if r.Format == "" {
		r.Format = FormatDefault
	}

	if r.MaxConcurrency == 0 {
		r.MaxConcurrency = 1
	}

	if r.Headers == nil {
		r.Headers = http.Header{}
	}

	if r.Config == nil {
		r.Config = map[string]string{}
	}

	if r.Timeout == 0 {
		r.Timeout = defaultRouteTimeout
	}

	//if r.IdleTimeout == 0 {
	//	r.IdleTimeout = htfnScaleDownTimeout
	//}
}
863268
func (d *API) WithJSONDefaults() *API {
	d.DefaultConsumes = runtime.JSONMime
	d.DefaultProduces = runtime.JSONMime
	d.consumers[runtime.JSONMime] = runtime.JSONConsumer()
	d.producers[runtime.JSONMime] = runtime.JSONProducer()
	return d
}
1237139
func TimeWithDefault(val *time.Time, defaultValue time.Time) time.Time {
	if val == nil {
		return defaultValue
	}
	return *val
}