Improve errors

Signed-off-by: Maartje Eyskens <maartje@eyskens.me>
This commit is contained in:
Maartje Eyskens 2020-02-18 11:17:20 +01:00
parent 1439ca350c
commit 560fe3828d

View File

@ -16,13 +16,12 @@ func main() {
loadVariant()
if len(flag.Args()) < 1 {
fmt.Println("Usage: filter-crd <CRD YAML file>")
return
log.Fatal("Usage: filter-crd <CRD YAML file>")
}
f, err := os.Open(flag.Args()[0])
if err != nil {
log.Fatal("Error opening file", err)
log.Fatal("Error opening file: ", err)
}
decoder := yaml.NewDecoder(f)
@ -39,7 +38,7 @@ func main() {
fileOut, err := yaml.Marshal(d)
if err != nil {
log.Fatal("Error marshaling output", err)
log.Fatal("Error marshaling output: ", err)
}
output = append(output, string(fileOut))