mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
Fix load single config auto format. (#1354)
This commit is contained in:
parent
b467f44ef0
commit
05f96fc434
@ -135,8 +135,8 @@ func LoadConfig(formatName string, input interface{}) (*Config, error) {
|
|||||||
// * string of a single filename/url(s) to open to read
|
// * string of a single filename/url(s) to open to read
|
||||||
// * io.Reader that reads a config content (the original way)
|
// * io.Reader that reads a config content (the original way)
|
||||||
func loadSingleConfigAutoFormat(input interface{}) (*Config, error) {
|
func loadSingleConfigAutoFormat(input interface{}) (*Config, error) {
|
||||||
if file, ok := input.(string); ok {
|
if file, ok := input.(cmdarg.Arg); ok {
|
||||||
extension := getExtension(file)
|
extension := getExtension(file.String())
|
||||||
if extension != "" {
|
if extension != "" {
|
||||||
lowerName := strings.ToLower(extension)
|
lowerName := strings.ToLower(extension)
|
||||||
if f, found := configLoaderByExt[lowerName]; found {
|
if f, found := configLoaderByExt[lowerName]; found {
|
||||||
|
Loading…
Reference in New Issue
Block a user