Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for newTestConn (0.18 sec)

  1. src/net/http/serve_test.go

    type testConn struct {
    	readMu   sync.Mutex // for TestHandlerBodyClose
    	readBuf  bytes.Buffer
    	writeBuf bytes.Buffer
    	closec   chan bool // 1-buffered; receives true when Close is called
    	noopConn
    }
    
    func newTestConn() *testConn {
    	return &testConn{closec: make(chan bool, 1)}
    }
    
    func (c *testConn) Read(b []byte) (int, error) {
    	c.readMu.Lock()
    	defer c.readMu.Unlock()
    	return c.readBuf.Read(b)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 202K bytes
    - Viewed (0)
Back to top