mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix(package): [netutil] bracket IPv6 dial addresses (#398)
This commit is contained in:
1 parent
e49a01e725
commit
3b94ec1932
2 files changed
+22
-1
No files matched your search
+1
-1
@@ -315,7 +315,7 @@ func IsPingConnected(host string) bool {
|
||||
// IsTelnetConnected checks if can telnet specified host or not.
|
||||
// Play: https://go.dev/play/p/yiLCGtQv_ZG
|
||||
func IsTelnetConnected(host string, port string) bool {
|
||||
adder := host + ":" + port
|
||||
adder := net.JoinHostPort(host, port)
|
||||
conn, err := net.DialTimeout("tcp", adder, 5*time.Second)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user