Skip to content

Commit e9ff6c9

Browse files
committed
🌱 (chore): check and return error from os.WriteFile when writing litout.json
1 parent 6452e9f commit e9ff6c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎docs/book/utils/plugin/plugin.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ func Run(plug Plugin, inputRaw io.Reader, outputRaw io.Writer, args ...string) e
6464
return fmt.Errorf("unable to write output book object: %v", err)
6565
}
6666

67-
os.WriteFile("/tmp/litout.json", out, os.ModePerm)
67+
if err = os.WriteFile("/tmp/litout.json", out, os.ModePerm); err != nil {
68+
return fmt.Errorf("unable to write output book object: %v", err)
69+
}
6870

6971
return nil
7072
}

0 commit comments

Comments
 (0)