Update config.go

pull/4926/head
xqzr 2025-07-23 19:05:12 +08:00 committed by GitHub
parent dbd9125686
commit 74814a3b4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 5 deletions

View File

@ -108,16 +108,13 @@ func LoadConfig(formatName string, input interface{}) (*Config, error) {
files := make([]*ConfigSource, len(v)) files := make([]*ConfigSource, len(v))
hasProtobuf := false hasProtobuf := false
for i, file := range v { for i, file := range v {
var f string var f string = formatName
if formatName == "auto" { if formatName == "auto" {
f = "json"
if file != "stdin:" { if file != "stdin:" {
f = getFormat(file) f = getFormat(file)
} else {
f = "json"
} }
} else {
f = formatName
} }
if f == "" { if f == "" {