From a3c5de641b04cb2f6624034a769a3443764c158d Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 14 Sep 2021 10:29:58 -0700 Subject: [PATCH] portlist: stop logging stray UDP ports These "weird" port lines show up in logs frequently. They're the result of uninteresting races, and they're not actionable. Remove the noise. Remove the isLoopbackAddr case to placate staticcheck. Signed-off-by: Josh Bleecher Snyder --- portlist/portlist_macos.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/portlist/portlist_macos.go b/portlist/portlist_macos.go index 82ba0b35d..9ed541679 100644 --- a/portlist/portlist_macos.go +++ b/portlist/portlist_macos.go @@ -12,7 +12,6 @@ import ( "bytes" "fmt" "log" - "os" "os/exec" "strings" "sync/atomic" @@ -99,10 +98,8 @@ func addProcesses(pl []Port) ([]Port, error) { switch { case p != nil: p.Process = cmd - case isLoopbackAddr(val): - // ignore default: - fmt.Fprintf(os.Stderr, "weird: missing %v\n", pp) + // ignore: processes and ports come and go } } }