Skip to content

Commit ecf5771

Browse files
authored
Merge pull request #4746 from kersten/fix/litout-writefile-error
🌱 (chore): check and return error from os.WriteFile when writing litout.json
2 parents 2ef22f8 + e9ff6c9 commit ecf5771

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)