(ctx stdContext.Context, e *Echo)
| 26 | ) |
| 27 | |
| 28 | func startOnRandomPort(ctx stdContext.Context, e *Echo) (string, error) { |
| 29 | addrChan := make(chan string) |
| 30 | errCh := make(chan error) |
| 31 | |
| 32 | go func() { |
| 33 | errCh <- (&StartConfig{ |
| 34 | Address: ":0", |
| 35 | GracefulTimeout: 100 * time.Millisecond, |
| 36 | ListenerAddrFunc: func(addr net.Addr) { |
| 37 | addrChan <- addr.String() |
| 38 | }, |
| 39 | }).Start(ctx, e) |
| 40 | }() |
| 41 | |
| 42 | return waitForServerStart(addrChan, errCh) |
| 43 | } |
| 44 | |
| 45 | func waitForServerStart(addrChan <-chan string, errCh <-chan error) (string, error) { |
| 46 | waitCtx, cancel := stdContext.WithTimeout(stdContext.Background(), 200*time.Millisecond) |
no test coverage detected
searching dependent graphs…