add Go's ServeMux Request.PathValue access semantics to Exchange, Mux and MuxSlice

This commit is contained in:
Patricio Whittingslow
2026-07-29 16:26:20 -03:00
parent 546f11e375
commit 6b54f74dd5
9 changed files with 394 additions and 53 deletions
+4 -2
View File
@@ -225,9 +225,11 @@ func (mb *KVBuffer) At(i int) (key, value []byte) {
}
func (mb *KVBuffer) setAt(i int, k, v []byte) {
mb.flags |= flagMangledBuffer
// Route through slice, not bytes2tok: a nil v is a pair with no '=' and must
// stay absent rather than trip the alias check on a nil pointer.
mb.kvs[i] = argsKV{
key: bytes2tok(mb.buf, k),
value: bytes2tok(mb.buf, v),
key: mb.slice(k),
value: mb.slice(v),
}
}