1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-16 00:00:05 +01:00

Fix if function and adds error handling

This commit is contained in:
ibib 2017-01-29 12:27:31 +01:00
parent 38d95a12a2
commit f83fa24467

View file

@ -85,11 +85,14 @@ func runSnapshots(opts SnapshotOptions, gopts GlobalOptions, args []string) erro
}
if gopts.JSON == true {
jsonoutput(list)
} else {
naturaloutput(list)
if gopts.JSON {
err := jsonoutput(list)
if err != nil {
fmt.Fprintf(os.Stderr, "error printing snapshot: %v\n", err)
}
return nil
}
naturaloutput(list)
return nil
}