diff --git a/net/net_linux.go b/net/net_linux.go index 93cb037..6db04b6 100644 --- a/net/net_linux.go +++ b/net/net_linux.go @@ -552,7 +552,7 @@ func getProcInodes(root string, pid int32, max int) (map[string][]inodeMap, erro return ret, err } defer f.Close() - dirEntries, err := readDir(f, max) + dirEntries, err := f.ReadDir(max) if err != nil { return ret, err } diff --git a/net/net_linux_111.go b/net/net_linux_111.go deleted file mode 100644 index c173944..0000000 --- a/net/net_linux_111.go +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -//go:build !go1.16 - -package net - -import ( - "os" -) - -func readDir(f *os.File, max int) ([]os.FileInfo, error) { - return f.Readdir(max) -} diff --git a/net/net_linux_116.go b/net/net_linux_116.go deleted file mode 100644 index f7a3687..0000000 --- a/net/net_linux_116.go +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -//go:build go1.16 - -package net - -import ( - "os" -) - -func readDir(f *os.File, max int) ([]os.DirEntry, error) { - return f.ReadDir(max) -} diff --git a/net/net_linux_netlink_test.go b/net/net_linux_netlink_test.go deleted file mode 100644 index 2d01a1a..0000000 --- a/net/net_linux_netlink_test.go +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -//go:build linux - -package net - -import "testing" - -func BenchmarkGetConnectionsInet(b *testing.B) { - b.ResetTimer() - for i := 0; i < b.N; i++ { - Connections("inet") - } -} - -func BenchmarkGetConnectionsAll(b *testing.B) { - b.ResetTimer() - for i := 0; i < b.N; i++ { - Connections("all") - } -}