From 8f969117ab6dfc78f1c754813747517423b3b472 Mon Sep 17 00:00:00 2001 From: Lomanic Date: Wed, 20 May 2020 23:50:21 +0200 Subject: [PATCH] [process][darwin][nocgo] Fix #867 iterate on every lines returned by lsof to handle potential warnings --- process/process_darwin_nocgo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process/process_darwin_nocgo.go b/process/process_darwin_nocgo.go index 86466fd..3583e19 100644 --- a/process/process_darwin_nocgo.go +++ b/process/process_darwin_nocgo.go @@ -22,7 +22,7 @@ func (p *Process) ExeWithContext(ctx context.Context) (string, error) { } txtFound := 0 lines := strings.Split(string(out), "\n") - for i := 1; i < len(lines); i += 2 { + for i := 1; i < len(lines); i++ { if lines[i] == "ftxt" { txtFound++ if txtFound == 2 {