ref: c287fedbdc38de1ce9d5ab62433b1fa0366b85c3
parent: 1cfa0119efe15e4175e1299ba86ef3b97527a20c
author: penny <penny@limitedideas.org>
date: Wed Oct 1 11:27:19 EDT 2025
goimports pass
--- a/config.go
+++ b/config.go
@@ -5,9 +5,9 @@
"fmt"
"io/ioutil"
"os"
- "time"
"strings"
-
+ "time"
+
"github.com/pelletier/go-toml/v2"
)
@@ -14,15 +14,15 @@
const configFileName = ".hell.conf"
type Hellprefs struct {- Apidelay float32 `toml:"apidelay" comment:"Time in seconds between API requests, accepts floats"`
- Save_Location string `toml:"save_location" comment:"Save location for /download"`
- Browser string `toml:"browser" comment:"System browser command."`
- ImageViewer string `toml:"image_viewer" comment:"System image viewer command."`
- MediaImport string `toml:"media_importer" comment:"Alternative media command used with /import"`
+ Apidelay float32 `toml:"apidelay" comment:"Time in seconds between API requests, accepts floats"`
+ Save_Location string `toml:"save_location" comment:"Save location for /download"`
+ Browser string `toml:"browser" comment:"System browser command."`
+ ImageViewer string `toml:"image_viewer" comment:"System image viewer command."`
+ MediaImport string `toml:"media_importer" comment:"Alternative media command used with /import"`
}
type account_array struct {- AccountConfigs []*mastodon_account `toml:"account"`
+ AccountConfigs []*mastodon_account `toml:"account"`
}
type mastodon_account struct {MASTODON_CLIENT_ID string `toml:"MASTODON_CLIENT_ID"`
@@ -69,11 +69,11 @@
func initPrefs() Hellprefs { prefs := &Hellprefs{- Apidelay: 2,
+ Apidelay: 2,
Save_Location: "~/Downloads",
- Browser: "xdg-open '%s'",
- ImageViewer: "xdg-open '%s'",
- MediaImport: "xdg-open '%s'",
+ Browser: "xdg-open '%s'",
+ ImageViewer: "xdg-open '%s'",
+ MediaImport: "xdg-open '%s'",
}
return *prefs
}
@@ -129,7 +129,7 @@
if len(config.AccountConfigs) < 1 { return nil, fmt.Errorf("empty config?\n")}
-
+
prefval := config.AccountConfigs[0].Preferences
prefs := &prefval
prefs, fixed := fixPrefs(prefs)
--- a/main.go
+++ b/main.go
@@ -345,7 +345,7 @@
return
case "account":
var account *mastodon.Account
- if foundindex || index == ""{+ if foundindex || index == "" {account = &postItem.Account
} else {account = hc.resolveAccount(index)
--- a/mastodon.go
+++ b/mastodon.go
@@ -34,7 +34,7 @@
if err != nil {log.Fatal(err)
}
-
+
fmt.Printf("Open your browser to \n%s\n and copy/paste the given authroization code\n", u)var userAuthorizationCode string
fmt.Print("Paste the code here:")--- a/pages.go
+++ b/pages.go
@@ -58,13 +58,13 @@
if getter.page == nil { getter.page = &mastodon.Pagination{}}
- if getter.page.MaxID == "" && getter.page.MinID != ""{+ if getter.page.MaxID == "" && getter.page.MinID != "" {return nil, nil
}
getter.page.MinID = ""
getter.page.Limit = int64(limit)
statuses, err := getter.getter(context.Background(), getter.page)
-
+
return statuses, err
}
@@ -78,7 +78,7 @@
if getter.page == nil { getter.page = &mastodon.Pagination{}}
- if getter.page.MaxID == "" && getter.page.MinID != ""{+ if getter.page.MaxID == "" && getter.page.MinID != "" {return nil, nil
}
getter.page.MinID = ""
@@ -246,7 +246,7 @@
func (page *Page) String() string {var sb strings.Builder
page.findindex.Do(page.findIndexEnd)
-
+
var items []PageItem
items = (*page.itembuffer)[page.index:page.indexend]
--
⑨