On Mon, Nov 28, 2016 at 7:18 PM Pietro Gagliardi <andl...@lostsig.net>
wrote:

> What is this supposed to be doing? I tried going through the git history
to find any context and the only thing I can figure is that there are lots
of leftovers from super early Go (in fact, this whole test suite is full of
them...). In particular, shouldn't the first line there not be different
from just the test on b?

IIRC, I think the runtime pads, or used to pad, strings with a zero byte
for easy compatibility with C strings and CGO interop. The runtime
conversion to []byte seems to preserve, or used to preserve that trailing
zero byte. The test checks that DecodeRune is not tripped by the zero byte
trailer, ditto DecodeRuneInString.
-- 

-j

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to