backend: simplify condition
This commit is contained in:
parent
db210ebc5e
commit
e824f4982e
@ -109,12 +109,10 @@ func main() {
|
||||
for {
|
||||
select {
|
||||
case ev := <-watcher.Events:
|
||||
if ev.Op & fsnotify.Create == fsnotify.Create {
|
||||
if d, err := os.Stat(ev.Name); err == nil && d.IsDir() && ev.Op & fsnotify.Create == fsnotify.Create {
|
||||
// Register new subdirectory
|
||||
if d, err := os.Stat(ev.Name); err == nil && d.IsDir() {
|
||||
if err := watchsubdir(watcher, ev.Name); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
if err := watchsubdir(watcher, ev.Name); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
} else if ev.Op & fsnotify.Write == fsnotify.Write {
|
||||
go treat(ev.Name)
|
||||
|
Loading…
Reference in New Issue
Block a user