Skip to content

Commit a264c5d

Browse files
authored
Use os.Lstat over os.Stat (#292)
1 parent b52777b commit a264c5d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/drivers/host_driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"bytes"
2929

3030
"github.com/GoogleContainerTools/container-structure-test/pkg/types/unversioned"
31-
"github.com/google/go-containerregistry/pkg/v1"
31+
v1 "github.com/google/go-containerregistry/pkg/v1"
3232
)
3333

3434
type HostDriver struct {
@@ -140,7 +140,7 @@ func (d *HostDriver) ProcessCommand(envVars []unversioned.EnvVar, fullCommand []
140140
}
141141

142142
func (d *HostDriver) StatFile(path string) (os.FileInfo, error) {
143-
return os.Stat(path)
143+
return os.Lstat(path)
144144
}
145145

146146
func (d *HostDriver) ReadFile(path string) ([]byte, error) {

pkg/drivers/tar_driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
pkgutil "github.com/GoogleContainerTools/container-diff/pkg/util"
2727
"github.com/GoogleContainerTools/container-structure-test/pkg/types/unversioned"
28-
"github.com/google/go-containerregistry/pkg/v1"
28+
v1 "github.com/google/go-containerregistry/pkg/v1"
2929
"github.com/google/go-containerregistry/pkg/v1/mutate"
3030
)
3131

@@ -139,7 +139,7 @@ func (d *TarDriver) ProcessCommand(_ []unversioned.EnvVar, _ []string) (string,
139139
}
140140

141141
func (d *TarDriver) StatFile(path string) (os.FileInfo, error) {
142-
return os.Stat(filepath.Join(d.Image.FSPath, path))
142+
return os.Lstat(filepath.Join(d.Image.FSPath, path))
143143
}
144144

145145
func (d *TarDriver) ReadFile(path string) ([]byte, error) {

0 commit comments

Comments
 (0)