I think that's the question. Here's a simpler example, 
https://play.golang.org/p/9Kv3PhlM-OF

That is, is 00 an expected %02x representation of a zero-length byte
slice?

The answer to that is yes; the 02 forces leading zeros. The %x verb
essentially renders bit strings as hex, so a zero-length bit string
with mandated two leading zeros is 00.

If you leave out the 02, you get the expected empty string.

https://play.golang.org/p/uVFt3lecKxf

On Fri, 2020-12-18 at 15:38 -0800, Marcin Romaszewicz wrote:
> It's expected behavior.
> 
> Your for loop runs once for l=0, since your condition is <=0 because
> len([]byte{}) is 0.
> 
> -- Marcin


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f2ca98609ca0992e0a734022584cb5a95e605175.camel%40kortschak.io.

Reply via email to