From 3b5be0e6d8c24b08db626b1e8d92ae5cf2c28cca Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Tue, 18 May 2021 09:47:17 -0700 Subject: [PATCH] Random changes for an old tool. --- cmd/md2leveldb/md2leveldb.go | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/cmd/md2leveldb/md2leveldb.go b/cmd/md2leveldb/md2leveldb.go index c928687..27ffef9 100644 --- a/cmd/md2leveldb/md2leveldb.go +++ b/cmd/md2leveldb/md2leveldb.go @@ -38,36 +38,7 @@ func load(dbPath, mdPath string) error { skipPats := strings.Split(*skipFiles, ",") glog.Infoln("Skip files", skipPats) imported, count := 0, 0 - if err := filepath.Walk(mdPath, func(path string, info os.FileInfo, err error) error { - base := filepath.Base(path) - if info.IsDir() { - glog.Infoln(path) - for _, pat := range skipPats { - ok, err := filepath.Match(pat, base) - if err != nil { - return err - } - if ok { - return filepath.SkipDir - - } - } - } - - if !info.Mode().IsRegular() { - return nil - } - for _, pat := range skipPats { - ok, err := filepath.Match(pat, base) - if err != nil { - return err - } - if ok { - return nil - - } - } - + if err := maildir.Walk(mdPath, func(path string) error { r, err := os.Open(path) if err != nil { return fmt.Errorf("%q open: %v", path, err)