// Default sets the pipe defaults
493918
func (Pipe) Default(ctx *context.Context) error {
	for i := range ctx.Config.Dockers {
		var docker = &ctx.Config.Dockers[i]

		if docker.Image != "" {
			deprecate.Notice("docker.image")
			deprecate.Notice("docker.tag_templates")

			if len(docker.TagTemplates) == 0 {
				docker.TagTemplates = []string{"{{ .Version }}"}
			}

			for _, tag := range docker.TagTemplates {
				docker.ImageTemplates = append(
					docker.ImageTemplates,
					fmt.Sprintf("%s:%s", docker.Image, tag),
				)
			}
		}

		if docker.Binary != "" {
			deprecate.Notice("docker.binary")
			docker.Binaries = append(docker.Binaries, docker.Binary)
		}

		if docker.Goos == "" {
			docker.Goos = "linux"
		}
		if docker.Goarch == "" {
			docker.Goarch = "amd64"
		}
	}
	// only set defaults if there is exactly 1 docker setup in the config file.
	if len(ctx.Config.Dockers) != 1 {
		return nil
	}
	if len(ctx.Config.Dockers[0].Binaries) == 0 {
		ctx.Config.Dockers[0].Binaries = []string{
			ctx.Config.Builds[0].Binary,
		}
	}
	if ctx.Config.Dockers[0].Dockerfile == "" {
		ctx.Config.Dockers[0].Dockerfile = "Dockerfile"
	}
	return nil
}
985169
func (Pipe) Default(ctx *context.Context) error {
	var env = &ctx.Config.EnvFiles
	if env.GitHubToken == "" {
		env.GitHubToken = "~/.config/goreleaser/github_token"
	}
	return nil
}
725211
func Default() types.Importer {
	return &customImporter{
		imported:      make(map[string]*types.Package),
		base:          importer.Default(),
		skipTestFiles: true,
	}
}
1040508
func DefaultConfig() Config {
	// explicit
	return Config{
		Hostname:      "",
		Port:          4444,
		KeyFile:       "",
		CertFile:      "",
		WorkingDir:    "." + string(os.PathSeparator), // alm-tools should end with path separator.
		Username:      "",
		Password:      "",
		DisableOutput: false,
	}
}
1264355
func (Pipe) Default(ctx *context.Context) error {
	if ctx.Config.ProjectName == "" {
		ctx.Config.ProjectName = ctx.Config.Release.GitHub.Name
	}
	return nil
}
288934
func (p *Project) defaults() {
	p.Memory = DefaultMemory
	p.Timeout = DefaultTimeout
	p.IgnoreFile = []byte(".apexignore\nfunction.json\n")

	if p.Concurrency == 0 {
		p.Concurrency = 5
	}

	if p.Config.Environment == nil {
		p.Config.Environment = make(map[string]string)
	}

	if p.NameTemplate == "" {
		p.NameTemplate = "{{.Project.Name}}_{{.Function.Name}}"
	}

	if p.RetainedVersions == nil {
		p.RetainedVersions = aws.Int(DefaultRetainedVersions)
	}
}
132646
func defaultCommands() map[string]Command {
	return map[string]Command{
		"Put":              put,
		"PutIfAbsent":      putIfAbsent,
		"CompareAndSwap":   compareAndSwap,
		"CompareAndRemove": compareAndRemove,
		"Remove":           remove,
		"Noop":             noop,
	}

}
290493
func DefaultConfig() *Config {
	return &Config{
		MetadataExtractor: nil,
		NetclsProgrammer:  nil,
		EnableHostPods:    false,
		Kubeconfig:        "",
		Nodename:          "",
	}
}
450097
func (o *Config) defaults() *Config {
	if o.OutputDir == "" {
		o.OutputDir = "."
	}
	if o.InputFiles == nil {
		o.InputFiles = []string{"-"}
	}
	if o.OutputFiles == nil {
		o.OutputFiles = []string{"-"}
	}
	if o.LDelim == "" {
		o.LDelim = "{{"
	}
	if o.RDelim == "" {
		o.RDelim = "}}"
	}
	return o
}
857559
func (Pipe) Default(ctx *context.Context) error {
	for i := range ctx.Config.Artifactories {
		ctx.Config.Artifactories[i].ChecksumHeader = "X-Checksum-SHA256"
	}
	return http.Defaults(ctx.Config.Artifactories)
}
118739
func (f *FloatRule) Default() ctypes.ConfigValue {
	if f.default_ != nil {
		return ctypes.ConfigValueFloat{Value: *f.default_}
	}
	return nil
}
642619
func Defaults(puts []config.Put) error {
	for i := range puts {
		defaults(&puts[i])
	}
	return nil
}
690905
func DefaultName(name string) string {
	return fmt.Sprintf("%s-%X", name, Rand(int(^uint(0)>>1)))
}
1263499
func Default(method, contentType string) Binding {
	if method == "GET" {
		return Form
	}

	switch contentType {
	case MIMEJSON:
		return JSON
	case MIMEXML, MIMEXML2:
		return XML
	case MIMEPROTOBUF:
		return ProtoBuf
	case MIMEMSGPACK, MIMEMSGPACK2:
		return MsgPack
	case MIMEYAML:
		return YAML
	case MIMEMultipartPOSTForm:
		return FormMultipart
	default: // case MIMEPOSTForm:
		return Form
	}
}
1219165
func (e Entry) StringDefault(def string) string {
	v := e.ValueRaw

	if vString, ok := v.(string); ok {
		return vString
	}

	return def
}
233954
func DefaultConfig() Config {
	return Config{
		Network:     DefaultRedisNetwork,
		Addr:        DefaultRedisAddr,
		Password:    "",
		Database:    "",
		MaxIdle:     0,
		MaxActive:   0,
		IdleTimeout: DefaultRedisIdleTimeout,
		Prefix:      "",
	}
}
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
	}
}