I have a goroutenie with scanner.Scan
It looks like:
```
cnn.SetReadDeadline(time.Now().Add(c.rTimeout)) // 10s
scanner := bufio.NewScanner(cnn)
for scanner.Scan() {
...
}
```
cnn is a net.Conn there
My problem is when I call cnn.Close() (and I tried
cnn.SetReadDeadline(time.Now()) in addition
Can you wrap the call to scanner.Scan in a func that has access to the
ccn context and returns false when it's closed?
On Thu, 2018-12-13 at 14:04 -0800, Ivan Korjavin wrote:
> I have a goroutenie with scanner.Scan
> It looks like:
>
> ```
> cnn.SetReadDeadline(time.Now().Add(c.rTimeout)) // 10s
Can you post a short, self-contained (compile-able and runnable) example which
shows the problem? Preferably hosted on play.golang.org for easy sharing and
editing.
If the scanner is reading from a reader which has been closed (returns io.EOF),
the sc.Scan should return false (and the sc.Err wo