Fix potential data race in test
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 9 Apr 2016 12:25:33 +0000 (14:25 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 9 Apr 2016 12:30:22 +0000 (14:30 +0200)
hugolib/shortcode.go

index 36d2058f1dbf9d0a27738b072c4608414b845f6a..876e9293f53aefc78f33520b7851213da8427747 100644 (file)
@@ -558,7 +558,9 @@ func renderShortcodeWithPage(tmpl *template.Template, data *ShortcodeWithPage) s
        buffer := bp.GetBuffer()
        defer bp.PutBuffer(buffer)
 
+       isInnerShortcodeCache.RLock()
        err := tmpl.Execute(buffer, data)
+       isInnerShortcodeCache.RUnlock()
        if err != nil {
                jww.ERROR.Println("error processing shortcode", tmpl.Name(), "\n ERR:", err)
                jww.WARN.Println(data)