Skip to content

Commit

Permalink
util: imp error check
Browse files Browse the repository at this point in the history
  • Loading branch information
ainar-g committed Jan 13, 2021
1 parent c2bdbce commit 742fba2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/util/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ func ContainsString(strs []string, str string) bool {
}

// FileExists returns true if file exists.
//
// TODO(a.garipov): !! check stat error.
func FileExists(fn string) bool {
_, err := os.Stat(fn)
return err == nil
return err == nil || !os.IsNotExist(err)
}

// RunCommand runs shell command.
Expand Down

0 comments on commit 742fba2

Please sign in to comment.