shithub: hell

Download patch

ref: c7c61a886fefb1179632c82fc3d533157ddfca9a
parent: c4768a1fde5130cc18cc07e83de1bada10506fd0
author: fops <billgates@cock.li>
date: Fri Oct 17 14:39:07 EDT 2025

add err check, reduce use of fmt.Sprintf

--- a/main.go
+++ b/main.go
@@ -181,6 +181,9 @@
 			case "read":
 				defer hc.prompt.UpdatePrompt()
 				notifications, err := hc.GetUnreadNotifications()
+				if err != nil {
+					fmt.Print(err)
+				}
 				if len(notifications) > 0 {
 					err = hc.SetNotificationsRead(notifications[len(notifications)-1].ID)
 					if err != nil {
--- a/mastodon.go
+++ b/mastodon.go
@@ -190,10 +190,10 @@
 func (hc *Hellclient) RenderPostPlaintext(post *mastodon.Status, ref postref) (selectedPost *mastodon.Status, plaintext string) {
 	if post.Reblog != nil {
 		selectedPost = post.Reblog
-		plaintext = fmt.Sprintf("$username Reblogged $index $boostuser $boostcontent $boosted_media_descriptions")
+		plaintext = "$username Reblogged $index $boostuser $boostcontent $boosted_media_descriptions"
 	} else {
 		selectedPost = post
-		plaintext = fmt.Sprintf("$standard_status")
+		plaintext = "$standard_status"
 	}
 	formatter := &StatusFormatter{prefs: hc.preferences, status: post, postContext: &ref}
 	templater := newStatusTemplateRenderer(formatter)
@@ -253,7 +253,7 @@
 				templater := newStatusTemplateRenderer(formatter)
 				if hc.isPaused {
 					hc.actionBuffer = append(hc.actionBuffer, func() {
-						line, _ := templater.render(fmt.Sprintf("$username EDITED: $index $content $media_descriptions\n"))
+						line, _ := templater.render("$username EDITED: $index $content $media_descriptions\n")
 						fmt.Print(line)
 					})
 					justIncrementPostref(hc.homeref, post.Status)
@@ -260,7 +260,7 @@
 					idmap[post.Status.ID] = post.Status
 					return
 				}
-				line, _ := templater.render(fmt.Sprintf("$username EDITED: $index $content $media_descriptions\n"))
+				line, _ := templater.render("$username EDITED: $index $content $media_descriptions\n")
 				fmt.Print(line)
 				justIncrementPostref(hc.homeref, post.Status)
 				idmap[post.Status.ID] = post.Status
--- a/pages.go
+++ b/pages.go
@@ -165,9 +165,9 @@
 		}
 		var plaintext string
 		if formatter.status.Reblog != nil {
-			plaintext = fmt.Sprintf("$standard_reblog")
+			plaintext = "$standard_reblog"
 		} else {
-			plaintext = fmt.Sprintf("$standard_status")
+			plaintext = "$standard_status"
 		}
 		line, _ := templater.render(plaintext)
 		item := makePageItem(line)
--