Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19d1277

Browse files
authored
Merge pull request #49209 from thaJeztah/27.x_backport_deprecate_GetTotalUsedFds
[27.x backport] pkg/fileutils: deprecate GetTotalUsedFds
2 parents 9146968 + bdd3a95 commit 19d1277

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ issues:
150150
path: "api/types/(volume|container)/"
151151
linters:
152152
- revive
153+
# FIXME temporarily suppress these until we migrated these to internal.
154+
- text: "SA1019: fileutils\\.GetTotalUsedFds"
155+
linters:
156+
- staticcheck
153157
# FIXME temporarily suppress these (see https://github.com/gotestyourself/gotest.tools/issues/272)
154158
- text: "SA1019: (assert|cmp|is)\\.ErrorType is deprecated"
155159
linters:

pkg/fileutils/fileutils_darwin.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import (
1414
// "-n", and "-P" options to omit looking up user-names, host-names, and port-
1515
// names. See [LSOF(8)].
1616
//
17+
// Deprecated: this function is only used internally, and will be removed in the next release.
18+
//
1719
// [LSOF(8)]: https://opensource.apple.com/source/lsof/lsof-49/lsof/lsof.man.auto.html
1820
func GetTotalUsedFds() int {
1921
output, err := exec.Command("lsof", "-lnP", "-Ff", "-p", strconv.Itoa(os.Getpid())).CombinedOutput()

pkg/fileutils/fileutils_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313

1414
// GetTotalUsedFds Returns the number of used File Descriptors by
1515
// reading it via /proc filesystem.
16+
//
17+
// Deprecated: this function is only used internally, and will be removed in the next release.
1618
func GetTotalUsedFds(ctx context.Context) int {
1719
ctx, span := tracing.StartSpan(ctx, "GetTotalUsedFds")
1820
defer span.End()

pkg/fileutils/fileutils_windows.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import "context"
44

55
// GetTotalUsedFds Returns the number of used File Descriptors. Not supported
66
// on Windows.
7+
//
8+
// Deprecated: this function is only used internally, and will be removed in the next release.
79
func GetTotalUsedFds(ctx context.Context) int {
810
return -1
911
}

0 commit comments

Comments
 (0)