func LoadExistsByFormat(format string, sourceFiles ...string) error {
	return dc.LoadExistsByFormat(format, sourceFiles...)
}
LoadExistsByFormat load one or multi files by give format
package config
import (
	"flag"
	"fmt"
	"io"
	"net/http"
	"os"
	"path/filepath"
	"strings"
	"time"
	"github.com/imdario/mergo"
	"github.com/pkg/errors"
)
func LoadDir(dir, suffix string) error { return dc.LoadDir(dir, suffix) }
func (c *Config) LoadDir(dir, suffix string) (err error) {
	fileList := []string{}
	err = filepath.Walk(dir, func(path string, f os.FileInfo, err error) error {
		ok := strings.HasSuffix(f.Name(), suffix)
		if ok {
			fileList = append(fileList, filepath.FromSlash(path))
		}
		return nil
	})
	if err != nil {
		return
	}
	for _, file := range fileList {
		if err = c.loadFile(file, false, ""); err != nil {
			return
		}
	}
	return
}
func LoadFiles(sourceFiles ...string) error { return dc.LoadFiles(sourceFiles...) }
func (c *Config) LoadFiles(sourceFiles ...string) (err error) {
	for _, file := range sourceFiles {
		if err = c.loadFile(file, false, ""); err != nil {
			return
		}
	}
	return
}
func LoadExists(sourceFiles ...string) error { return dc.LoadExists(sourceFiles...) }
func (c *Config) LoadExists(sourceFiles ...string) (err error) {
	for _, file := range sourceFiles {
		if err = c.loadFile(file, true, ""); err != nil {
			return
		}
	}
	return
}
func LoadRemote(format, url string) error { return dc.LoadRemote(format, url) }
func (c *Config) LoadRemote(format, url string) (err error) {
	client := http.Client{Timeout: 300 * time.Second}
	resp, err := client.Get(url)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	if resp.StatusCode != 200 {
		return fmt.Errorf("fetch remote resource error, reply status code is not equals to 200")
	}
	bts, err := io.ReadAll(resp.Body)
	if err == nil {
		if err = c.parseSourceCode(format, bts); err != nil {
			return
		}
		c.loadedFiles = append(c.loadedFiles, url)
	}
	return
}
func LoadOSEnv(keys []string, keyToLower bool) { dc.LoadOSEnv(keys, keyToLower) }
func (c *Config) LoadOSEnv(keys []string, keyToLower bool) {
	for _, key := range keys {
		val := os.Getenv(key)
		if keyToLower {
			key = strings.ToLower(key)
		}
		_ = c.Set(key, val)
	}
}
var validTypes = map[string]int{
	"int":  1,
	"uint": 1,
	"bool": 1,
	"string": 1,
}
func LoadFlags(keys []string) error { return dc.LoadFlags(keys) }
func (c *Config) LoadFlags(keys []string) (err error) {
	hash := map[string]interface{}{}
	for _, key := range keys {
		key, typ := parseVarNameAndType(key)
		switch typ {
		case "int":
			ptr := new(int)
			flag.IntVar(ptr, key, c.Int(key), "")
			hash[key] = ptr
		case "uint":
			ptr := new(uint)
			flag.UintVar(ptr, key, c.Uint(key), "")
			hash[key] = ptr
		case "bool":
			ptr := new(bool)
			flag.BoolVar(ptr, key, c.Bool(key), "")
			hash[key] = ptr
		default:  
			ptr := new(string)
			flag.StringVar(ptr, key, c.String(key), "")
			hash[key] = ptr
		}
	}
	flag.Parse()
	flag.Visit(func(f *flag.Flag) {
		name := f.Name
		if _, ok := hash[name]; !ok {
			return
		}
		_ = c.Set(name, f.Value.String())
	})
	return
}
func parseVarNameAndType(key string) (string, string) {
	typ := "string"
	key = strings.Trim(key, "-")
	if strings.IndexByte(key, ':') > 0 {
		list := strings.SplitN(key, ":", 2)
		key, typ = list[0], list[1]
		if _, ok := validTypes[typ]; !ok {
			typ = "string"
		}
	}
	return key, typ
}
func LoadData(dataSource ...interface{}) error { return dc.LoadData(dataSource...) }
func (c *Config) LoadData(dataSources ...interface{}) (err error) {
	if c.opts.Delimiter == 0 {
		c.opts.Delimiter = defaultDelimiter
	}
	for _, ds := range dataSources {
		err = mergo.Merge(&c.data, ds, mergo.WithOverride)
		if err != nil {
			return
		}
	}
	return
}
func LoadSources(format string, src []byte, more ...[]byte) error {
	return dc.LoadSources(format, src, more...)
}
func (c *Config) LoadSources(format string, src []byte, more ...[]byte) (err error) {
	err = c.parseSourceCode(format, src)
	if err != nil {
		return
	}
	for _, sc := range more {
		err = c.parseSourceCode(format, sc)
		if err != nil {
			return
		}
	}
	return
}
func LoadStrings(format string, str string, more ...string) error {
	return dc.LoadStrings(format, str, more...)
}
func (c *Config) LoadStrings(format string, str string, more ...string) (err error) {
	err = c.parseSourceCode(format, []byte(str))
	if err != nil {
		return
	}
	for _, s := range more {
		err = c.parseSourceCode(format, []byte(s))
		if err != nil {
			return
		}
	}
	return
}
func LoadFilesByFormat(format string, sourceFiles ...string) error {
	return dc.LoadFilesByFormat(format, sourceFiles...)
}
func (c *Config) LoadFilesByFormat(format string, sourceFiles ...string) (err error) {
	for _, file := range sourceFiles {
		if err = c.loadFile(file, false, format); err != nil {
			return
		}
	}
	return
}