mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Use bufferpool in Rst handler
This commit is contained in:
parent
00d70e5569
commit
d9bc233f1f
1 changed files with 3 additions and 2 deletions
|
@ -517,8 +517,9 @@ func getRstContent(content []byte) []byte {
|
||||||
|
|
||||||
cmd := exec.Command(path, "--leave-comments")
|
cmd := exec.Command(path, "--leave-comments")
|
||||||
cmd.Stdin = bytes.NewReader(cleanContent)
|
cmd.Stdin = bytes.NewReader(cleanContent)
|
||||||
var out bytes.Buffer
|
out := bufferpool.GetBuffer()
|
||||||
cmd.Stdout = &out
|
defer bufferpool.PutBuffer(out)
|
||||||
|
cmd.Stdout = out
|
||||||
if err := cmd.Run(); err != nil {
|
if err := cmd.Run(); err != nil {
|
||||||
jww.ERROR.Println(err)
|
jww.ERROR.Println(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue