fix:优化逻辑

This commit is contained in:
Mmx
2021-07-17 17:01:46 +08:00
parent 231a8a4cf7
commit f0c262a2b0
2 changed files with 2 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ type daemon struct {
var Daemon = daemon{
Mark: fmt.Sprint(time.Now().UnixNano()),
Path: "autoLoginDaemon",
Path: ".autoLoginDaemon",
}
func init() {

View File

@@ -18,13 +18,7 @@ func (a *file) Exists(path string) bool {
return false
}
_, err = os.Stat(root + path)
if err != nil {
if os.IsExist(err) {
return true
}
return false
}
return true
return err == nil || os.IsExist(err)
}
func (a *file) Read(path string) ([]byte, error) {