summaryrefslogtreecommitdiff
path: root/internal/platforms/mastodon/mastodon.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/platforms/mastodon/mastodon.go')
-rw-r--r--internal/platforms/mastodon/mastodon.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/internal/platforms/mastodon/mastodon.go b/internal/platforms/mastodon/mastodon.go
index 390de4c..d4f9e7b 100644
--- a/internal/platforms/mastodon/mastodon.go
+++ b/internal/platforms/mastodon/mastodon.go
@@ -27,16 +27,9 @@ func Post(ctx context.Context, args config.Args, sizeLimit int, ent entry.Entry)
log.Println("Not posting", ent, "to Mastodon as dry-run enabled")
return nil
}
- switch prompt.DoYouWantThis("Do you want to post this message to Mastodon?", content) {
- case prompt.No:
- return prompt.ErrAborted
- case prompt.Yes:
- case prompt.Edit:
- panic("edit not yet implemented") // TODO
- default:
- panic("should never happen")
+ if err := prompt.DoYouWantThis("Do you want to post this message to Mastodon?", content); err != nil {
+ return err
}
-
req, err := http.NewRequestWithContext(ctx, "POST", args.Secrets.MastodonURL, bytes.NewBuffer(payloadBytes))
if err != nil {
return fmt.Errorf("failed to create request: %w", err)