diff --git a/main.go b/main.go index 3e4503ce9..88c34e413 100644 --- a/main.go +++ b/main.go @@ -221,17 +221,16 @@ func main() { // options parsing. // // See https://github.com/AdguardTeam/dnsproxy/issues/182. - if len(arg) > 13 { - if arg[:13] == "--config-path" { - fmt.Printf("Path: %s\n", arg[14:]) - b, err := os.ReadFile(arg[14:]) - if err != nil { - log.Fatalf("failed to read the config file %s: %v", arg[14:], err) - } - err = yaml.Unmarshal(b, options) - if err != nil { - log.Fatalf("failed to unmarshal the config file %s: %v", arg[14:], err) - } + if len(arg) > 13 && arg[:13] == "--config-path" { + fmt.Printf("dnsproxy config path: %s\n", arg[14:]) + b, err := os.ReadFile(arg[14:]) + if err != nil { + log.Fatalf("failed to read the config file %s: %v", arg[14:], err) + } + + err = yaml.Unmarshal(b, options) + if err != nil { + log.Fatalf("failed to unmarshal the config file %s: %v", arg[14:], err) } } }