()
| 63 | } |
| 64 | |
| 65 | func (c *testConn) serve() { |
| 66 | defer c.c.Close() |
| 67 | c.br = bufio.NewReader(c.c) |
| 68 | c.bw = bufio.NewWriter(c.c) |
| 69 | for { |
| 70 | line, err := c.br.ReadSlice('\n') |
| 71 | if err != nil { |
| 72 | if errors.Is(err, io.EOF) { |
| 73 | return |
| 74 | } |
| 75 | return |
| 76 | } |
| 77 | if !c.handleRequestLine(string(line)) { |
| 78 | panic(fmt.Sprintf("unhandled request line in testServer: %q", line)) |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func (c *testConn) reply(msg string) bool { |
| 84 | fmt.Fprintf(c.bw, "%s\r\n", msg) |
no test coverage detected