(target string, timeout time.Duration)
| 1488 | } |
| 1489 | |
| 1490 | func checkSSHPortReachable(target string, timeout time.Duration) bool { |
| 1491 | if strings.TrimSpace(target) == "" { |
| 1492 | return false |
| 1493 | } |
| 1494 | conn, err := net.DialTimeout("tcp", net.JoinHostPort(target, "22"), timeout) |
| 1495 | if err != nil { |
| 1496 | return false |
| 1497 | } |
| 1498 | _ = conn.Close() |
| 1499 | return true |
| 1500 | } |
| 1501 | |
| 1502 | func boolPtr(v bool) *bool { |
| 1503 | return &v |
no test coverage detected