MCPcopy
hub / github.com/bradfitz/gomemcache / serve

Method serve

memcache/fakeserver_test.go:65–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63}
64
65func (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
83func (c *testConn) reply(msg string) bool {
84 fmt.Fprintf(c.bw, "%s\r\n", msg)

Callers 1

ServeMethod · 0.95

Calls 2

handleRequestLineMethod · 0.95
CloseMethod · 0.80

Tested by

no test coverage detected