From 05f96fc4346abc699fa61b22e66d1e502ef918d0 Mon Sep 17 00:00:00 2001 From: Jachin Date: Mon, 1 Nov 2021 11:28:57 +0800 Subject: [PATCH] Fix load single config auto format. (#1354) --- config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index ad7e5ec48..d912c9bfd 100644 --- a/config.go +++ b/config.go @@ -135,8 +135,8 @@ func LoadConfig(formatName string, input interface{}) (*Config, error) { // * string of a single filename/url(s) to open to read // * io.Reader that reads a config content (the original way) func loadSingleConfigAutoFormat(input interface{}) (*Config, error) { - if file, ok := input.(string); ok { - extension := getExtension(file) + if file, ok := input.(cmdarg.Arg); ok { + extension := getExtension(file.String()) if extension != "" { lowerName := strings.ToLower(extension) if f, found := configLoaderByExt[lowerName]; found {