You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: script.go
    path of file: ./repos/lefthook/internal/config
    
    the code of the file until where you have to start completion: package config

import (
	"strings"

	"github.com/mitchellh/mapstructure"
	"github.com/spf13/viper"

	"github.com/evilmartians/lefthook/internal/git"
)

type Script struct {
	Runner string `mapstructure:"runner" yaml:"runner" json:"runner" toml:"runner"`

	Skip interface{}       `mapstructure:"skip" yaml:",omitempty" json:"skip,omitempty" toml:"skip,omitempty,inline"`
	Only interface{}       `mapstructure:"only" yaml:",omitempty" json:"only,omitempty" toml:"only,omitempty,inline"`
	Tags []string          `mapstructure:"tags" yaml:",omitempty" json:"tags,omitempty" toml:"tags,omitempty"`
	Env  map[string]string `mapstructure:"env"  yaml:",omitempty" json:"env,omitempty"  toml:"env,omitempty"`

	FailText    string `mapstructure:"fail_text"   yaml:"fail_text,omitempty"   json:"fail_text,omitempty"   toml:"fail_text,omitempty"`
	Interactive
    
func mergeScripts(base, extra *viper.Viper) (map[string]*Script, error) {
	if base == nil && extra == nil {
		return nil, nil
	}

	if base == nil {
		return unmarshalScripts(extra.GetStringMap("scripts"))
	}

	if extra == nil {
		return unmarshalScripts(base.GetStringMap("scripts"))
	}

	scriptsOrigin := base.GetStringMap("scripts")
	scriptsOverride := extra.GetStringMap("scripts")
	if scriptsOrigin == nil {
		return unmarshalScripts(scriptsOverride)
	}
	if scriptsOverride == nil {
		return unmarshalScripts(scriptsOrigin)
	}

	runReplaces := make(map[string]*scriptRunnerReplace)
	for key, originConfig := range scriptsOrigin {
		var runReplace scriptRunnerReplace

		if err := unmarshal(originConfig, &runReplace); err != nil {
			return nil, err
		}

		runReplaces[key] = &runReplace
	}

	err := base.MergeConfigMap(map[string]interface{}{
		"scripts": scriptsOverride,
	})
	if err != nil {
		return nil, err
	}

	scripts, err := unmarshalScripts(base.GetStringMap("scripts"))
	if err != nil {
		return nil, err
	}

	for key, replace := range runReplaces {
		if replace.Runner != "" {
			scripts[key].Runner = strings.ReplaceAll(scripts[key].Runner, CMD, replace.Runner)
		}
	}

	return scripts, nil
}