summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/run.go8
-rw-r--r--internal/schedule/schedule.go1
2 files changed, 4 insertions, 5 deletions
diff --git a/internal/run.go b/internal/run.go
index ea70bec..a3d42df 100644
--- a/internal/run.go
+++ b/internal/run.go
@@ -17,13 +17,13 @@ func Run(ctx context.Context, args config.Args) error {
for _, platform := range args.Platforms {
path, err := schedule.Run(args, platform)
- switch err {
- case nil:
+ switch {
+ case err == nil:
log.Println("Scheduling", path)
// TODO: Implement action here to post it
- case schedule.ErrNothingToSchedule:
+ case errors.Is(err, schedule.ErrNothingToSchedule):
log.Println("Nothing to be scheduled for", platform)
- case schedule.ErrNothingQueued
+ case errors.Is(err, schedule.ErrNothingQueued):
log.Println("Nothing queued for", platform)
default:
return err
diff --git a/internal/schedule/schedule.go b/internal/schedule/schedule.go
index 82afc18..3d3061f 100644
--- a/internal/schedule/schedule.go
+++ b/internal/schedule/schedule.go
@@ -35,7 +35,6 @@ func Run(args config.Args, platform string) (string, error) {
})
if err != nil {
- // TODO: FIX THIS
return randomEntry, fmt.Errorf("%w: %w", ErrNothingQueued, err)
}
return randomEntry, nil