3 ms·
Ah yes, you are absolutely right. I actually modified Rust's regex C API in part because of this problem in Go. I can't remember the details, but they were simi
by burntsushi 10y ago
Ah yes, you are absolutely right. I actually modified Rust's regex C API in part because of this problem in Go. I can't remember the details, but they were similar to your example where the only way to work around it was an unavoidable additional allocation.
(Of course, I think the change led to a better overall API. Go just helped me get there in a circuitous way.)