1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Fix crash if remote validator is not configured. Small cosmetics.

This commit is contained in:
Sascha L. Teichmann 2023-01-30 08:23:05 +01:00
parent adf98736cc
commit 6a60e8d8ce

View file

@ -41,7 +41,7 @@ func main() {
}
if len(files) == 0 {
log.Println("No domains given.")
log.Println("No files given.")
return
}
@ -86,9 +86,10 @@ func run(opts *options, files []string) error {
fmt.Printf(" * %s\n", vErr)
}
} else {
fmt.Printf("%s passes the schema validation.\n", file)
fmt.Printf("%q passes the schema validation.\n", file)
}
// Validate against remote validator.
if validator != nil {
validate, err := validator.Validate(doc)
if err != nil {
return fmt.Errorf("remote validation of %q failed: %w",
@ -102,6 +103,7 @@ func run(opts *options, files []string) error {
}
fmt.Printf("%q %s remote validation.\n", file, passes)
}
}
return nil
}