From 5419e3eea33c0974364af43b9c893fb927fd8115 Mon Sep 17 00:00:00 2001 From: shirou Date: Sat, 24 Feb 2024 02:03:51 +0000 Subject: [PATCH] [net][linux]: remove unused files. go1.11 is not supported now. --- net/net_linux.go | 2 +- net/net_linux_111.go | 12 ------------ net/net_linux_116.go | 12 ------------ net/net_linux_netlink_test.go | 20 -------------------- 4 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 net/net_linux_111.go delete mode 100644 net/net_linux_116.go delete mode 100644 net/net_linux_netlink_test.go diff --git a/net/net_linux.go b/net/net_linux.go index 93cb03775..6db04b627 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 c173944ac..000000000 --- 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 f7a368799..000000000 --- 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 2d01a1a46..000000000 --- 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") - } -}