NewPartialInputReader builds a reader with a default 64KiB buffer limit. Tool inputs are tiny in practice (<2KB); the cap guards against pathological streams.
()
| 63 | // limit. Tool inputs are tiny in practice (<2KB); the cap guards |
| 64 | // against pathological streams. |
| 65 | func NewPartialInputReader() *PartialInputReader { |
| 66 | return &PartialInputReader{ |
| 67 | emitted: make(map[string]struct{}), |
| 68 | maxBuffer: 64 * 1024, |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | // WithMaxBuffer overrides the safety cap. Negative or zero disables |
| 73 | // the cap entirely (caller assumes the risk of unbounded growth). |
no outgoing calls