(ctx context.Context, conn *websocket.Conn, timeout time.Duration)
| 64 | } |
| 65 | |
| 66 | func pingWithTimeout(ctx context.Context, conn *websocket.Conn, timeout time.Duration) error { |
| 67 | ctx, cancel := context.WithTimeout(ctx, timeout) |
| 68 | defer cancel() |
| 69 | err := conn.Ping(ctx) |
| 70 | if err != nil { |
| 71 | return xerrors.Errorf("failed to ping: %w", err) |
| 72 | } |
| 73 | |
| 74 | return nil |
| 75 | } |
no test coverage detected