-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data race in Template.Parse #181
Comments
I tried to have a go at fixing this, and my first instinct would be to: t.parseInit.Do(func() {
if strings.Contains(t.Src, leftDelim) {
gt, err := gotemplate.New("").Funcs(funcs).Delims(leftDelim, rightDelim).Parse(t.Src)
t.Template = gt
t.ParseErr = err
}
}) But that doesn't work since you take |
Thanks for reporting, I will take a look!
This might be the right path forward. |
Technically, each translation could define its own set of delimiters, but that actually isn't the problem here I think since those delimiters would be stored in the translation file and I could lift those parameter out of the parse function.
The limiting factor here is actually |
This should be fixed in v2.0.1 |
I get a data race reported in some of Hugo's tests:
https://travis-ci.org/gohugoio/hugo/jobs/540393974
https://github.com/nicksnyder/go-i18n/blob/master/internal/template.go#L16
The text was updated successfully, but these errors were encountered: