Files
gookit-goutil/strutil
dualfroz e2e5b5495f fix(strutil): keep center-aligned Resize within the requested length
The center branch of resize() added the odd-padding space whenever the
input was non-empty, because the parity check omitted the source length
(wantLen - padLn*2 instead of wantLen - sLen - padLn*2). This made Resize,
Align and their utf8 variants overflow wantLen by one for every non-empty
string with an even amount of padding. Subtract sLen so the extra space is
only added when the total padding is actually odd.
2026-09-04 09:07:10 +02:00
..