hugolib: Add a temporary workaround for page.copy() data race

See ##3129
This commit is contained in:
Bjørn Erik Pedersen 2017-03-05 15:40:59 +01:00
parent c7b8c45d12
commit 6c5ef71368

View file

@ -1655,6 +1655,9 @@ func (p *Page) updatePageDates() {
// copy creates a copy of this page with the lazy sync.Once vars reset
// so they will be evaluated again, for word count calculations etc.
func (p *Page) copy() *Page {
// This is a temporary workaround for the data race in #3129
p.getPermalink()
c := *p
c.pageInit = &pageInit{}
return &c