summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/containers.go
diff options
context:
space:
mode:
authorEng Zer Jun <engzerjun@gmail.com>2022-09-11 15:58:31 +0800
committerEng Zer Jun <engzerjun@gmail.com>2022-09-11 15:58:31 +0800
commit118546c6a70704a7b19cb99f3c948b28264628de (patch)
tree5eb092820335de6860d5b5304a2a3e02f8125d03 /pkg/domain/infra/abi/containers.go
parentb9cbc0c09a68be7bb55048a494753c77c08bfbd3 (diff)
downloadpodman-118546c6a70704a7b19cb99f3c948b28264628de.tar.gz
podman-118546c6a70704a7b19cb99f3c948b28264628de.tar.bz2
podman-118546c6a70704a7b19cb99f3c948b28264628de.zip
refactor: use `os.ReadDir` for lightweight directory reading
`os.ReadDir` was added in Go 1.16 as part of the deprecation of `ioutil` package. It is a more efficient implementation than `ioutil.ReadDir`. Reference: https://pkg.go.dev/io/ioutil#ReadDir Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Diffstat (limited to 'pkg/domain/infra/abi/containers.go')
-rw-r--r--pkg/domain/infra/abi/containers.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index dfa3c5ba0..569fe8133 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
- "io/ioutil"
"os"
"strconv"
"sync"
@@ -858,7 +857,7 @@ func makeExecConfig(options entities.ExecOptions, rt *libpod.Runtime) (*libpod.E
func checkExecPreserveFDs(options entities.ExecOptions) error {
if options.PreserveFDs > 0 {
- entries, err := ioutil.ReadDir("/proc/self/fd")
+ entries, err := os.ReadDir("/proc/self/fd")
if err != nil {
return err
}