diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-04-22 15:10:13 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-04-25 13:23:20 +0200 |
commit | c7b16645aff27fff0b87bb2a98298693bbf20894 (patch) | |
tree | d93f86c9e13f0f87f09eb048929add31e13f8f93 /libpod/container_stat_linux.go | |
parent | ad3da638ce17439a7adbf2aa7e1b4017d583f660 (diff) | |
download | podman-c7b16645aff27fff0b87bb2a98298693bbf20894.tar.gz podman-c7b16645aff27fff0b87bb2a98298693bbf20894.tar.bz2 podman-c7b16645aff27fff0b87bb2a98298693bbf20894.zip |
enable unparam linter
The unparam linter is useful to detect unused function parameters and
return values.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/container_stat_linux.go')
-rw-r--r-- | libpod/container_stat_linux.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libpod/container_stat_linux.go b/libpod/container_stat_linux.go index 84ab984e0..9e225de2e 100644 --- a/libpod/container_stat_linux.go +++ b/libpod/container_stat_linux.go @@ -4,7 +4,6 @@ package libpod import ( - "context" "os" "path/filepath" "strings" @@ -18,12 +17,12 @@ import ( // statInsideMount stats the specified path *inside* the container's mount and PID // namespace. It returns the file info along with the resolved root ("/") and // the resolved path (relative to the root). -func (c *Container) statInsideMount(ctx context.Context, containerPath string) (*copier.StatForItem, string, string, error) { +func (c *Container) statInsideMount(containerPath string) (*copier.StatForItem, string, string, error) { resolvedRoot := "/" resolvedPath := c.pathAbs(containerPath) var statInfo *copier.StatForItem - err := c.joinMountAndExec(ctx, + err := c.joinMountAndExec( func() error { var statErr error statInfo, statErr = secureStat(resolvedRoot, resolvedPath) @@ -38,7 +37,7 @@ func (c *Container) statInsideMount(ctx context.Context, containerPath string) ( // along with the resolved root and the resolved path. Both paths are absolute // to the host's root. Note that the paths may resolved outside the // container's mount point (e.g., to a volume or bind mount). -func (c *Container) statOnHost(ctx context.Context, mountPoint string, containerPath string) (*copier.StatForItem, string, string, error) { +func (c *Container) statOnHost(mountPoint string, containerPath string) (*copier.StatForItem, string, string, error) { // Now resolve the container's path. It may hit a volume, it may hit a // bind mount, it may be relative. resolvedRoot, resolvedPath, err := c.resolvePath(mountPoint, containerPath) @@ -50,7 +49,7 @@ func (c *Container) statOnHost(ctx context.Context, mountPoint string, container return statInfo, resolvedRoot, resolvedPath, err } -func (c *Container) stat(ctx context.Context, containerMountPoint string, containerPath string) (*define.FileInfo, string, string, error) { +func (c *Container) stat(containerMountPoint string, containerPath string) (*define.FileInfo, string, string, error) { var ( resolvedRoot string resolvedPath string @@ -75,11 +74,11 @@ func (c *Container) stat(ctx context.Context, containerMountPoint string, contai if c.state.State == define.ContainerStateRunning { // If the container is running, we need to join it's mount namespace // and stat there. - statInfo, resolvedRoot, resolvedPath, statErr = c.statInsideMount(ctx, containerPath) + statInfo, resolvedRoot, resolvedPath, statErr = c.statInsideMount(containerPath) } else { // If the container is NOT running, we need to resolve the path // on the host. - statInfo, resolvedRoot, resolvedPath, statErr = c.statOnHost(ctx, containerMountPoint, containerPath) + statInfo, resolvedRoot, resolvedPath, statErr = c.statOnHost(containerMountPoint, containerPath) } if statErr != nil { |