From bcdf2caa61b59467c0e692c90ad149e94345f497 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 14 Mar 2022 18:52:10 +0000 Subject: [PATCH] Make lint happy Mostly new-style Go build directives Signed-off-by: Bryan Boreham --- app/multitenant/collector.go | 1 + probe/docker/network_linux.go | 1 + probe/docker/network_others.go | 1 + probe/endpoint/connection_tracker.go | 1 + probe/endpoint/conntrack.go | 1 + probe/endpoint/dns_snooper.go | 1 + probe/endpoint/dns_snooper_others.go | 1 + probe/endpoint/dns_snooper_test.go | 1 + probe/endpoint/ebpf.go | 1 + probe/endpoint/ebpf_test.go | 1 + probe/endpoint/nat.go | 1 + probe/endpoint/nat_internal_test.go | 1 + probe/endpoint/reporter_linux.go | 1 + probe/endpoint/reporter_other.go | 1 + prog/tools.go | 1 + report/tools.go | 1 + 16 files changed, 16 insertions(+) diff --git a/app/multitenant/collector.go b/app/multitenant/collector.go index 55e453142..68e3b7254 100644 --- a/app/multitenant/collector.go +++ b/app/multitenant/collector.go @@ -107,6 +107,7 @@ type pendingEntry struct { older []*report.Report } +// NewLiveCollector makes a new LiveCollector from the supplied config. func NewLiveCollector(config LiveCollectorConfig) (app.Collector, error) { c := &liveCollector{ cfg: config, diff --git a/probe/docker/network_linux.go b/probe/docker/network_linux.go index e7a182e1f..3a3d82d6f 100644 --- a/probe/docker/network_linux.go +++ b/probe/docker/network_linux.go @@ -1,4 +1,5 @@ // withNetNS function requires a fix that first appeared in Go version 1.10 +//go:build go1.10 // +build go1.10 package docker diff --git a/probe/docker/network_others.go b/probe/docker/network_others.go index 2f02f14d8..4f36105d7 100644 --- a/probe/docker/network_others.go +++ b/probe/docker/network_others.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux package docker diff --git a/probe/endpoint/connection_tracker.go b/probe/endpoint/connection_tracker.go index 14f94d79e..3c955516f 100644 --- a/probe/endpoint/connection_tracker.go +++ b/probe/endpoint/connection_tracker.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package endpoint diff --git a/probe/endpoint/conntrack.go b/probe/endpoint/conntrack.go index 52840c1e2..90636e7d5 100644 --- a/probe/endpoint/conntrack.go +++ b/probe/endpoint/conntrack.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package endpoint diff --git a/probe/endpoint/dns_snooper.go b/probe/endpoint/dns_snooper.go index e3058ac19..754a6893c 100644 --- a/probe/endpoint/dns_snooper.go +++ b/probe/endpoint/dns_snooper.go @@ -1,3 +1,4 @@ +//go:build (linux && amd64) || (linux && ppc64le) // +build linux,amd64 linux,ppc64le // Build constraint to use this file for amd64 & ppc64le on Linux diff --git a/probe/endpoint/dns_snooper_others.go b/probe/endpoint/dns_snooper_others.go index 3189dd8f7..439e8f20a 100644 --- a/probe/endpoint/dns_snooper_others.go +++ b/probe/endpoint/dns_snooper_others.go @@ -1,3 +1,4 @@ +//go:build darwin || arm || arm64 || s390x // +build darwin arm arm64 s390x // Cross-compiling the snooper requires having pcap binaries, diff --git a/probe/endpoint/dns_snooper_test.go b/probe/endpoint/dns_snooper_test.go index ade8e0a6e..f2a4e08e7 100644 --- a/probe/endpoint/dns_snooper_test.go +++ b/probe/endpoint/dns_snooper_test.go @@ -1,3 +1,4 @@ +//go:build (linux && amd64) || (linux && ppc64le) // +build linux,amd64 linux,ppc64le package endpoint diff --git a/probe/endpoint/ebpf.go b/probe/endpoint/ebpf.go index 06fa8e18c..53116a5a9 100644 --- a/probe/endpoint/ebpf.go +++ b/probe/endpoint/ebpf.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package endpoint diff --git a/probe/endpoint/ebpf_test.go b/probe/endpoint/ebpf_test.go index f5daa688e..f407a61ca 100644 --- a/probe/endpoint/ebpf_test.go +++ b/probe/endpoint/ebpf_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package endpoint diff --git a/probe/endpoint/nat.go b/probe/endpoint/nat.go index e3dd1f2a1..f63f73014 100644 --- a/probe/endpoint/nat.go +++ b/probe/endpoint/nat.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package endpoint diff --git a/probe/endpoint/nat_internal_test.go b/probe/endpoint/nat_internal_test.go index d4f3c4354..a830596b8 100644 --- a/probe/endpoint/nat_internal_test.go +++ b/probe/endpoint/nat_internal_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package endpoint diff --git a/probe/endpoint/reporter_linux.go b/probe/endpoint/reporter_linux.go index e465cc9cc..65fba32b0 100644 --- a/probe/endpoint/reporter_linux.go +++ b/probe/endpoint/reporter_linux.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package endpoint diff --git a/probe/endpoint/reporter_other.go b/probe/endpoint/reporter_other.go index bf77b5d64..29e9234e3 100644 --- a/probe/endpoint/reporter_other.go +++ b/probe/endpoint/reporter_other.go @@ -1,3 +1,4 @@ +//go:build !linux // +build !linux package endpoint diff --git a/prog/tools.go b/prog/tools.go index d71f291fc..0ef27b4b3 100644 --- a/prog/tools.go +++ b/prog/tools.go @@ -1,5 +1,6 @@ // Ensure go mod fetches files needed to build the Docker container; // the build constraint ensures this file is ignored +//go:build tools // +build tools package report diff --git a/report/tools.go b/report/tools.go index 8b08bc979..4c9ac7b71 100644 --- a/report/tools.go +++ b/report/tools.go @@ -1,5 +1,6 @@ // Ensure go mod fetches files needed at code generation time; // the build constraint ensures this file is ignored +//go:build tools // +build tools package report