Skip to content

Commit 282b91c

Browse files
authored
Split networkv2 into common + per-OS files (#54509)
<!--Please give us some feedback on your experience writing this PR ! https://app.datadoghq.com/forms/43db4c02-6837-400c-8083-692e141b1b88 !--> ### What does this PR do? Refactors the v2 Go network check (`networkv2`) so the pieces genuinely shared across platforms (check scaffolding, `Factory`, `Configure` boilerplate, basic interface metrics, device-exclusion check) live in `network.go`, with `network_linux.go` / `network_windows.go` holding only what's actually OS-specific. ### Motivation Pure code-organization cleanup: removes ~150 lines of near-identical boilerplate that was duplicated per platform, and paves the way for adding AIX support (as a `network_aix.go` reusing this shared base) in a follow-up PR without a third copy of that scaffolding. ### Describe how you validated your changes CI ### Additional Notes Just moving code, no expected impact. Co-authored-by: pierre.gimalac <pierre.gimalac@datadoghq.com>
1 parent 9c12327 commit 282b91c

5 files changed

Lines changed: 982 additions & 994 deletions

File tree

pkg/collector/corechecks/net/networkv2/BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ load("//bazel/rules/go:dd_agent_go_test.bzl", "dd_agent_go_test")
44
go_library(
55
name = "networkv2",
66
srcs = [
7-
"const.go",
7+
"const_linux.go",
88
"network.go",
9+
"network_linux.go",
910
"network_windows.go",
1011
"stub.go",
1112
],
File renamed without changes.

0 commit comments

Comments
 (0)