fix:优化逻辑
This commit is contained in:
@@ -14,7 +14,7 @@ type daemon struct {
|
|||||||
|
|
||||||
var Daemon = daemon{
|
var Daemon = daemon{
|
||||||
Mark: fmt.Sprint(time.Now().UnixNano()),
|
Mark: fmt.Sprint(time.Now().UnixNano()),
|
||||||
Path: "autoLoginDaemon",
|
Path: ".autoLoginDaemon",
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|||||||
@@ -18,13 +18,7 @@ func (a *file) Exists(path string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
_, err = os.Stat(root + path)
|
_, err = os.Stat(root + path)
|
||||||
if err != nil {
|
return err == nil || os.IsExist(err)
|
||||||
if os.IsExist(err) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *file) Read(path string) ([]byte, error) {
|
func (a *file) Read(path string) ([]byte, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user