-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
The current replace.RegexpTransformer offloads buffering to the calling code. It does this by repeatedly returning transform.ErrShortSrc until enough data is available. Even though this technically conforms to the documentation/contract, it fails when used with transform.Chain due to its internal (undocumented) 2kb buffering limit #5 golang/go#49117.
The replace.Chain was added as an alternative to transform.Chain. However, each call to Chain allocates 8kb for each underlying transform.Reader. I've opened a proposal to add a transform.Reader.Reset method, but the author of x/text is unresponsive.
We can avoid all these problems by doing the buffering ourselves.
Metadata
Metadata
Assignees
Labels
No labels