diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go index 0bdfcd5a5..41560c0f4 100644 --- a/hugolib/shortcode.go +++ b/hugolib/shortcode.go @@ -160,11 +160,10 @@ func isInnerShortcode(t *template.Template) bool { return m } - match, _ := regexp.MatchString("{{.*?\\.Inner.*?}}", t.Tree.Root.String()) - isInnerShortcodeCache.Lock() + defer isInnerShortcodeCache.Unlock() + match, _ := regexp.MatchString("{{.*?\\.Inner.*?}}", t.Tree.Root.String()) isInnerShortcodeCache.m[t.Name()] = match - isInnerShortcodeCache.Unlock() return match }