mirror of https://github.com/containers/podman.git
Refactor test to prevent panic
Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
parent
e7540d0406
commit
3bf594e262
|
|
@ -68,7 +68,8 @@ func aliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName {
|
||||||
// Check if a file exists and is not a directory
|
// Check if a file exists and is not a directory
|
||||||
func checkIfFileExists(name string) bool {
|
func checkIfFileExists(name string) bool {
|
||||||
file, err := os.Stat(name)
|
file, err := os.Stat(name)
|
||||||
if os.IsNotExist(err) {
|
// All errors return file == nil
|
||||||
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return !file.IsDir()
|
return !file.IsDir()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue