From 2f006df7a6aff97bb69bb2b6ffd607890863ebf9 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 10 Oct 2024 10:34:26 +0300 Subject: initial timestamp package --- internal/queue/queue.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/queue') diff --git a/internal/queue/queue.go b/internal/queue/queue.go index 98a30ac..fcef897 100644 --- a/internal/queue/queue.go +++ b/internal/queue/queue.go @@ -7,11 +7,10 @@ import ( "path/filepath" "slices" "strings" - "time" "codeberg.org/snonux/gos/internal/config" - "codeberg.org/snonux/gos/internal/format" "codeberg.org/snonux/gos/internal/oi" + "codeberg.org/snonux/gos/internal/timestamp" ) // Strictly, we only operate on .txt files, but we also accept .md as Obsidian creates only .md files. @@ -38,10 +37,9 @@ func queueEntries(args config.Args) error { return err } - now := time.Now() for filePath := range ch { destPath := fmt.Sprintf("%s/db/%s.%s.queued", args.GosDir, - filepath.Base(filePath), now.Format(format.Time)) + filepath.Base(filePath), timestamp.Now()) if args.DryRun { log.Println("Not queueing entry", filePath, "to", destPath, "as dry-run mode enabled") continue -- cgit v1.2.3