This commit is contained in:
josc146
2023-05-18 22:48:37 +08:00
parent 18db41fd76
commit de7d6b3417
6 changed files with 38 additions and 20 deletions

View File

@@ -39,12 +39,9 @@ func (a *App) ReadJson(fileName string) (any, error) {
return data, nil
}
func (a *App) FileExists(fileName string) (bool, error) {
func (a *App) FileExists(fileName string) bool {
_, err := os.Stat(fileName)
if err == nil {
return true, nil
}
return false, err
return err == nil
}
type FileInfo struct {