diff --git a/http.go b/http.go index a56a456..bb5c090 100644 --- a/http.go +++ b/http.go @@ -71,15 +71,18 @@ func okHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "error =", err) } for _, dir := range c.Dirs { - log.Info("append dir", dir) - fmt.Fprintln(w, "append dir", dir) var found bool = false for _, d := range me.dirs { if d == dir { found = true } } - if ! found { + if found { + log.Info("dir already here", dir) + fmt.Fprintln(w, "dir already here", dir) + } else { + log.Info("append new dir", dir) + fmt.Fprintln(w, "append new dir", dir) me.dirs = append(me.dirs, dir) } }