From 861f1cb4ff82120a98e263a180221d3dd5210092 Mon Sep 17 00:00:00 2001 From: catalinaperalta Date: Tue, 9 Feb 2021 07:59:30 +0800 Subject: [PATCH] return write file error (#1380) --- src/go/cmd/api_view.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/go/cmd/api_view.go b/src/go/cmd/api_view.go index 055cc738b7d..e309b3c3fd2 100644 --- a/src/go/cmd/api_view.go +++ b/src/go/cmd/api_view.go @@ -94,7 +94,10 @@ func CreateAPIView(pkgDir, outputDir string) error { } filename := fmt.Sprintf("%s%s.json", outputDir, pkg.p.Name) file, _ := json.MarshalIndent(review, "", " ") - _ = ioutil.WriteFile(filename, file, 0644) + err = ioutil.WriteFile(filename, file, 0644) + if err != nil { + return err + } return nil }