ref: 23368b7c2f56121f9658b2f7431ed693ca6465c8
parent: 027d91d776b79d3a75125a191f511a2948d1b4b6
author: fops <billgates@cock.li>
date: Wed Oct 8 09:54:50 EDT 2025
Run go fmt and staticcheck
--- a/config.go
+++ b/config.go
@@ -3,7 +3,6 @@
import (
"bytes"
"fmt"
- "io/ioutil"
"os"
"strings"
"time"
@@ -151,7 +150,7 @@
return nil, "", fmt.Errorf("error marshalling config: %w", err)}
- err = ioutil.WriteFile(configpath, b.Bytes(), 0644)
+ err = os.WriteFile(configpath, b.Bytes(), 0644)
if err != nil { return nil, "", fmt.Errorf("error writing config file: %w", err)}
--- a/filehandler.go
+++ b/filehandler.go
@@ -163,7 +163,7 @@
path = expandDir(path)
file, err := os.Open(path)
if err != nil {- return nil, fmt.Errorf("error opening file: %s", path, err)+ return nil, fmt.Errorf("error opening %s: %s", path, err)}
return file, nil
}
--- a/references.go
+++ b/references.go
@@ -57,7 +57,7 @@
}
func saveRef(statusMap map[string]*mastodon.Status, post *mastodon.Status, index *postref) {- (statusMap)[index.prefix + index.ref] = post
+ (statusMap)[index.prefix+index.ref] = post
}
func IncrementSequence(r rune) (rune, bool) {--- a/renderer.go
+++ b/renderer.go
@@ -17,13 +17,13 @@
postContext *postref
notif *mastodon.Notification
// Index for posts that aren't using the ref in postref
- localindex string
+ localindex string
}
// Returns the rendered content of a status's rt
func (st *StatusFormatter) reblogContent() string {currentpost := st.status
- defer func(){st.status = currentpost}()+ defer func() { st.status = currentpost }()return st.statusContent(st.status.Reblog)
}
@@ -82,6 +82,7 @@
}
return sb.String()
}
+
// Stringer for current index
type indexString struct {*StatusFormatter
@@ -157,7 +158,7 @@
return dl.detailLine()
}
-//Boosted username stringer
+// Boosted username stringer
type boostedusername struct {*StatusFormatter
}
--
⑨