cmd/vulnreport: print created filename in vulnreport create
The "vulnreport create" command creates a new YAML file.
Print the name of the file created, so it can be cut-and-pasted
into the next command line.
Change-Id: I446323e93211a442c8b5f3869129fae9cd464e13
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/412414
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
diff --git a/cmd/vulnreport/main.go b/cmd/vulnreport/main.go
index 6a183b1..050d4c6 100644
--- a/cmd/vulnreport/main.go
+++ b/cmd/vulnreport/main.go
@@ -163,7 +163,12 @@
if !iss.CreatedAt.IsZero() {
year = iss.CreatedAt.Year()
}
- return r.Write(fmt.Sprintf("reports/GO-%04d-%04d.yaml", year, issueNumber))
+ filename := fmt.Sprintf("reports/GO-%04d-%04d.yaml", year, issueNumber)
+ if err := r.Write(filename); err != nil {
+ return err
+ }
+ fmt.Println(filename)
+ return nil
}
const todo = "TODO: fill this out"