From 9ac1dda0d9f2df0bbc4c2523933a89c7716f05d7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 10 Feb 2020 23:50:06 -0800 Subject: [PATCH] portlist: add a lint ignore for unused function. The function is indeed unused on linux, but we want it around so that unit tests exercise the netstat logic even on linux, even if it's only used on !linux. Signed-off-by: David Anderson --- portlist/netstat.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/portlist/netstat.go b/portlist/netstat.go index 82ddfdd99..9ebdc678c 100644 --- a/portlist/netstat.go +++ b/portlist/netstat.go @@ -132,6 +132,8 @@ func parsePortsNetstat(output string) List { return l } +//lint:ignore U1000 function is only used on !linux, but we want the +// unit test to run on linux, so we don't build-tag it away. func listPortsNetstat(args string) (List, error) { exe, err := exec.LookPath("netstat") if err != nil {