mocktransponder_test.go 610 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2013 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. package ipv6_test
  5. import (
  6. "net"
  7. "testing"
  8. )
  9. func connector(t *testing.T, network, addr string, done chan<- bool) {
  10. t.Helper()
  11. defer func() { done <- true }()
  12. c, err := net.Dial(network, addr)
  13. if err != nil {
  14. t.Error(err)
  15. return
  16. }
  17. c.Close()
  18. }
  19. func acceptor(t *testing.T, ln net.Listener, done chan<- bool) {
  20. t.Helper()
  21. defer func() { done <- true }()
  22. c, err := ln.Accept()
  23. if err != nil {
  24. t.Error(err)
  25. return
  26. }
  27. c.Close()
  28. }