config/exec.go
func (c *ExecConfig) Merge(o *ExecConfig) *ExecConfig {
	if c == nil {
		if o == nil {
			return nil
		}
		return o.Copy()
	}

	if o == nil {
		return c.Copy()
	}

	r := c.Copy()

	if o.Command != nil {
		r.Command = o.Command
	}

	if o.Enabled != nil {
		r.Enabled = o.Enabled
	}

	if o.Env != nil {
		r.Env = r.Env.Merge(o.Env)
	}

	if o.KillSignal != nil {
		r.KillSignal = o.KillSignal
	}

	if o.KillTimeout != nil {
		r.KillTimeout = o.KillTimeout
	}

	if o.ReloadSignal != nil {
		r.ReloadSignal = o.ReloadSignal
	}

	if o.Splay != nil {
		r.Splay = o.Splay
	}

	if o.Timeout != nil {
		r.Timeout = o.Timeout
	}

	return r
}
func (c *ExecConfig) Merge(o *ExecConfig) *ExecConfig {
	if c == nil {
		if o == nil {
			return nil
		}
		return o.Copy()
	}

	if o == nil {
		return c.Copy()
	}

	r := c.Copy()

	if o.Command != nil {
		r.Command = o.Command
	}

	if o.Enabled != nil {
		r.Enabled = o.Enabled
	}

	if o.Env != nil {
		r.Env = r.Env.Merge(o.Env)
	}

	if o.KillSignal != nil {
		r.KillSignal = o.KillSignal
	}

	if o.KillTimeout != nil {
		r.KillTimeout = o.KillTimeout
	}

	if o.ReloadSignal != nil {
		r.ReloadSignal = o.ReloadSignal
	}

	if o.Splay != nil {
		r.Splay = o.Splay
	}

	if o.Timeout != nil {
		r.Timeout = o.Timeout
	}

	return r
}
// Merge combines all values in this configuration with the values in the other
// configuration, with values in the other configuration taking precedence.
// Maps and slices are merged, most other values are overwritten. Complex
// structs define their own merge functionality.