text/template: remove concurrency from scanner
The concurrency makes for a fun demonstration (see the youtube video), but causes problems when other parts of the system want to interact with the scanner. Races result. Plus various changes to the package over time have introduced problems.
Change the scanner to be more traditional, proceeding in lockstep with the parser rather than independently. It should be easy to do and will simplify and perhaps speed up the whole thing.
I have a change that implements this, but am waiting for the next release cycle to start before sending it out for review.
Change https://go.dev/cl/421883 mentions this issue: text/template/parse: simplify I/O in lexing