func Merge(input interface{}, m map[string]interface{}) error {
	switch v := input.(type) {
	case string:
		err := mergeSingleFile(v, m)
		if err != nil {
			return err
		}
	case []string:
		for _, file := range v {
			err := mergeSingleFile(file, m)
			if err != nil {
				return err
			}
		}
	case cmdarg.Arg:
		for _, file := range v {
			err := mergeSingleFile(file, m)
			if err != nil {
				return err
			}
		}
	case []byte:
		err := mergeSingleFile(v, m)
		if err != nil {
			return err
		}
	case io.Reader:
		bs, err := io.ReadAll(v)
		if err != nil {
			return err
		}
		err = mergeSingleFile(bs, m)
		if err != nil {
			return err
		}
	default:
		return newError("unknow merge input type")
	}
	return nil
}
Merge loads inputs and merges them into m
it detects extension for merger selecting, or try all mergers
if no extension found
package mergers
import (
	"io"
	"path/filepath"
	"strings"
	core "github.com/v2fly/v2ray-core/v4"
	"github.com/v2fly/v2ray-core/v4/common/cmdarg"
)
func MergeAs(formatName string, input interface{}, m map[string]interface{}) error {
	f, found := mergersByName[formatName]
	if !found {
		return newError("format merger not found for: ", formatName)
	}
	return f.Merge(input, m)
}