github.com/goproxy0/go@v0.0.0-20171111080102-49cc0c489d2c/src/net/pipe_test.go (about) 1 // Copyright 2010 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package net_test 6 7 import ( 8 "net" 9 "testing" 10 11 "golang_org/x/net/nettest" 12 ) 13 14 func TestPipe(t *testing.T) { 15 nettest.TestConn(t, func() (c1, c2 net.Conn, stop func(), err error) { 16 c1, c2 = net.Pipe() 17 stop = func() { 18 c1.Close() 19 c2.Close() 20 } 21 return 22 }) 23 }