diff options
| author | Paul Buetow <paul@buetow.org> | 2024-11-19 22:46:05 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-11-19 22:46:05 +0200 |
| commit | 836d21a7c43f4ce84dfa1ada0552989be4a43ca9 (patch) | |
| tree | fe6dc637c2c916e10b1beff31d687edf0f994503 /internal/run.go | |
| parent | 1550fbf9c2b0602c4675f25cd92e389593894e58 (diff) | |
use of platform aliases
Diffstat (limited to 'internal/run.go')
| -rw-r--r-- | internal/run.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/run.go b/internal/run.go index a171ec7..b143cca 100644 --- a/internal/run.go +++ b/internal/run.go @@ -4,11 +4,11 @@ import ( "context" "errors" "log" - "strings" "codeberg.org/snonux/gos/internal/colour" "codeberg.org/snonux/gos/internal/config" "codeberg.org/snonux/gos/internal/entry" + "codeberg.org/snonux/gos/internal/platforms" "codeberg.org/snonux/gos/internal/platforms/linkedin" "codeberg.org/snonux/gos/internal/platforms/mastodon" "codeberg.org/snonux/gos/internal/prompt" @@ -37,7 +37,7 @@ func Run(ctx context.Context, args config.Args) error { return nil } -func runPlatform(ctx context.Context, args config.Args, platform string, sizeLimit int) error { +func runPlatform(ctx context.Context, args config.Args, platform platforms.Platform, sizeLimit int) error { en, err := schedule.Run(args, platform) switch { case errors.Is(err, schedule.ErrNothingToSchedule): @@ -52,7 +52,7 @@ func runPlatform(ctx context.Context, args config.Args, platform string, sizeLim colour.Infoln("Posting", en) var postCB func(context.Context, config.Args, int, entry.Entry) error - switch strings.ToLower(platform) { + switch platform.String() { case "mastodon": postCB = mastodon.Post case "linkedin": |
