Don't use a byte for your loops, use an int.

When your loop reaches 255 it is incremented to 0 which is still <= 255 so your 
loop never terminates.

On Mon, 25 May 2020, at 10:54 PM, Liam wrote:
> I would expect this to complete pretty quickly, but after 40 minutes (on 
> 1.13, linux/amd64), it hasn't printed a thing.
> 
> I'm following up a report of panic in QueryEscape: 
> https://github.com/golang/go/issues/38643
> 
> package main
> 
> import (
>  "net/url"
>  "fmt"
> )
> 
> func main() {
>  for a := byte(0); a <= 255; a++ {
>  if (a+1) % 8 == 0 { fmt.Println(a) }
>  for b := byte(0); b <= 255; b++ {
>  _ = url.QueryEscape(string([]byte{a,b}))
>  }
>  }
> }
> 

> --
>  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/17295814-834f-47a2-b6fb-76bbf4f5f95b%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/golang-nuts/17295814-834f-47a2-b6fb-76bbf4f5f95b%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/ba3881c4-30dd-4d64-b268-86176e4c02f7%40www.fastmail.com.

Reply via email to