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

Skip to content

Commit e45f203

Browse files
committed
pkg/fileutils: deprecate GetTotalUsedFds
This function is only used internally and has no external consumers. Mark it deprecated to be removed in the next release. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 68f80d1 commit e45f203

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
@@ -151,6 +151,10 @@ issues:
151151
path: "api/types/(volume|container)/"
152152
linters:
153153
- revive
154+
# FIXME temporarily suppress these until we migrated these to internal.
155+
- text: "SA1019: fileutils\\.GetTotalUsedFds"
156+
linters:
157+
- staticcheck
154158
# FIXME temporarily suppress these (see https://github.com/gotestyourself/gotest.tools/issues/272)
155159
- text: "SA1019: (assert|cmp|is)\\.ErrorType is deprecated"
156160
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)