From ea1166564a7e6e1555d4abc19b2d43b5d9c9d7af Mon Sep 17 00:00:00 2001 From: redstarcoder Date: Mon, 1 Oct 2018 15:39:47 -0400 Subject: [PATCH 1/3] Update FindIds doc and only set name once in loop --- robotgo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/robotgo.go b/robotgo.go index d2e2e3e..52b42dd 100644 --- a/robotgo.go +++ b/robotgo.go @@ -1565,7 +1565,7 @@ func FindNames() ([]string, error) { return strArr, err } -// FindIds find the all process id by the process name +// FindIds finds the all processes named with a subset of "name" (case insensitive), returning matching IDs. func FindIds(name string) ([]int32, error) { var pids []int32 nps, err := Process() @@ -1573,9 +1573,9 @@ func FindIds(name string) ([]int32, error) { return pids, err } + name = strings.ToLower(name) for i := 0; i < len(nps); i++ { psname := strings.ToLower(nps[i].Name) - name = strings.ToLower(name) abool := strings.Contains(psname, name) if abool { pids = append(pids, nps[i].Pid) From 51a2394a94c60beff033cef2ef5ef88bc7f2ccda Mon Sep 17 00:00:00 2001 From: vz Date: Tue, 2 Oct 2018 09:05:57 -0400 Subject: [PATCH 2/3] update godoc --- robotgo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robotgo.go b/robotgo.go index 52b42dd..545b50d 100644 --- a/robotgo.go +++ b/robotgo.go @@ -1565,7 +1565,7 @@ func FindNames() ([]string, error) { return strArr, err } -// FindIds finds the all processes named with a subset of "name" (case insensitive), returning matching IDs. +// FindIds finds the all processes named with a subset of "name" (case insensitive), return matching IDs. func FindIds(name string) ([]int32, error) { var pids []int32 nps, err := Process() From 2928787f513c6a262842033d78e5577f49fa8dab Mon Sep 17 00:00:00 2001 From: vz Date: Tue, 2 Oct 2018 10:08:19 -0400 Subject: [PATCH 3/3] update godoc --- robotgo.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/robotgo.go b/robotgo.go index 545b50d..c1279c0 100644 --- a/robotgo.go +++ b/robotgo.go @@ -1565,7 +1565,8 @@ func FindNames() ([]string, error) { return strArr, err } -// FindIds finds the all processes named with a subset of "name" (case insensitive), return matching IDs. +// FindIds finds the all processes named with a subset of "name" (case insensitive), +// return matched IDs. func FindIds(name string) ([]int32, error) { var pids []int32 nps, err := Process()