From f4d96179f364c59b5d8feea7256072857f61d501 Mon Sep 17 00:00:00 2001 From: ferhat elmas Date: Sun, 3 Dec 2017 04:39:23 +0100 Subject: [PATCH] cmd: Use strings.Contains (#65) - instead strings.Index check --- cmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd.go b/cmd.go index 0277921..63e27f9 100644 --- a/cmd.go +++ b/cmd.go @@ -169,7 +169,7 @@ func cmdWithPrint(addr net.TCPAddr, c byte, params ...byte) error { // targetToAddr tries to parse the target string, be it remote host:port // or local process's PID. func targetToAddr(target string) (*net.TCPAddr, error) { - if strings.Index(target, ":") != -1 { + if strings.Contains(target, ":") { // addr host:port passed var err error addr, err := net.ResolveTCPAddr("tcp", target)