From 64e260578a3415fee445e979d2a25847dfbe5041 Mon Sep 17 00:00:00 2001 From: sre Date: Mon, 20 Jun 2022 19:04:52 +0800 Subject: [PATCH] tcp/udp protocal color --- dial/dial.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dial/dial.go b/dial/dial.go index 8b1c61c..e433ad4 100644 --- a/dial/dial.go +++ b/dial/dial.go @@ -11,12 +11,13 @@ func PortDial(address, port, protocol string, timeout int) { red := color.New(color.FgRed).SprintFunc() yellow := color.New(color.FgYellow).SprintFunc() green := color.New(color.FgGreen).SprintFunc() + blue := color.New(color.FgBlue).SprintFunc() ip := digIp(address) if ip == "" { - fmt.Printf("%v ping: %v: Name or service not known\n", protocol, red(address)) + fmt.Printf("%v ping: %v: Name or service not known\n", blue(protocol), red(address)) return } - fmt.Printf("%v ping %v (%v) via port %v (timeout: %vs)...\n", protocol, address, ip, port, timeout) + fmt.Printf("%v ping %v (%v) via port %v (timeout: %vs)...\n", blue(protocol), address, ip, port, timeout) dialTarget := ip + ":" + port for {