go/src/text
Eli Bendersky 9ce28b518d text/template/parse: fix data race on lexer initialization
Before this change, `startParse` would write `lex.breakOK` and `lex.continueOK` when the lexer goroutine is already running, which is a potential race condition.

Makes `breakOK` and `continueOK` configuration flags passed when `lexer` is created, similarly to how `emitComment` works.

Fixes #53234

Change-Id: Ia65f6135509a758cd4c5a453b249a174f4fb3e21
Reviewed-on: https://go-review.googlesource.com/c/go/+/410414
Reviewed-by: Eli Bendersky <eliben@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2022-06-06 15:54:07 +00:00
..
scanner all: remove trailing blank doc comment lines 2022-04-01 18:18:07 +00:00
tabwriter all: remove trailing blank doc comment lines 2022-04-01 18:18:07 +00:00
template text/template/parse: fix data race on lexer initialization 2022-06-06 15:54:07 +00:00