summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-12-25 22:32:35 +0200
committerPaul Buetow <paul@buetow.org>2024-12-25 22:32:35 +0200
commitf8f7b6033fc1a393d4792082419747897580f7ef (patch)
tree95e29521df4c24e96a44f1e85f087f8bfd8de5fd
parenta3ace10a9bc7c540b8f02474aa68226af1b397af (diff)
it is already unitt ttested
-rw-r--r--internal/entry/entry.go1
-rw-r--r--internal/summary/summary.go20
2 files changed, 1 insertions, 20 deletions
diff --git a/internal/entry/entry.go b/internal/entry/entry.go
index 6e8b64c..7570c0b 100644
--- a/internal/entry/entry.go
+++ b/internal/entry/entry.go
@@ -120,7 +120,6 @@ func (en *Entry) Name() string {
offset -= 2
}
- // TODO: Unit test this
return strings.Join(parts[:offset], ".")
}
diff --git a/internal/summary/summary.go b/internal/summary/summary.go
index ca38620..fbb601b 100644
--- a/internal/summary/summary.go
+++ b/internal/summary/summary.go
@@ -16,11 +16,11 @@ func Run(ctx context.Context, args config.Args) error {
for _, dateStr := range args.SummaryFor {
glob := filepath.Join(args.GosDir, "db/platforms/*/", fmt.Sprintf("*%s*-??????.posted", dateStr))
-
paths, err := filepath.Glob(glob)
if err != nil {
return err
}
+
for _, path := range paths {
en, err := entry.New(path)
if err != nil {
@@ -30,23 +30,5 @@ func Run(ctx context.Context, args config.Args) error {
entries[en.Name()] = en
}
}
- // ch, err := oi.ReadDirCh(args.GosDir, find(args.GosDir, validExtensions...))
- // if err != nil {
- // return err
- // }
-
- // for filePath := range ch {
return nil
}
-
-// func find(path string, suffixes ...string) func(os.DirEntry) (string, bool) {
-// return func(file os.DirEntry) (string, bool) {
-// filePath := filepath.Join(path, file.Name())
-// for _, suffix := range suffixes {
-// if strings.HasSuffix(file.Name(), suffix) {
-// return filePath, true
-// }
-// }
-// return filePath, false
-// }
-// }