[go-nuts] context cancellation flake

2017-09-15 Thread Tamás Gulácsi
You "readBody" after "defer cancel()", so response length amd caching may provide you a body, maybe just a canceled context. -- 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 a

[go-nuts] context cancellation flake

2017-09-15 Thread kynrai
Hello, I was wondering if anyone could help me with understanding the behaviour of cancelling context on a request before its read. I am using golang 1.9 on macOS X sierra (latest) Sometimes this code returns context cancelled, sometimes it works. package main import ( "context" "io/i