瀏覽代碼

attempt two for skipping files in the file walk (#105)

Patrick Devine 1 年之前
父節點
當前提交
9e15635c2d
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      server/routes.go

+ 2 - 1
server/routes.go

@@ -195,7 +195,8 @@ func list(c *gin.Context) {
 		if !info.IsDir() {
 		if !info.IsDir() {
 			fi, err := os.Stat(path)
 			fi, err := os.Stat(path)
 			if err != nil {
 			if err != nil {
-				return err
+				log.Printf("skipping file: %s", fp)
+				return nil
 			}
 			}
 			path := path[len(fp)+1:]
 			path := path[len(fp)+1:]
 			slashIndex := strings.LastIndex(path, "/")
 			slashIndex := strings.LastIndex(path, "/")