This is an infinite loop:
for b := byte(0); b <= 255; b++ {
_ = url.QueryEscape(string([]byte{a,b}))
}
b will always be <= 255 because it is a byte.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this
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
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 :=