From: Adam Shamblin Date: Tue, 6 Dec 2022 07:22:09 +0000 (-0700) Subject: fix missing pointer X-Git-Url: https://git.vexinglabs.com/?a=commitdiff_plain;h=07c2517ec0fd1973abddcf34072d69d8fc6e9a8f;p=dead-tooter.git fix missing pointer --- diff --git a/main.go b/main.go index 46540c1..54131b6 100644 --- a/main.go +++ b/main.go @@ -7,19 +7,21 @@ import ( ) func main() { - //app := Application{} - //err := app.Load("dead-tooter") - app, err := mastodon.App{ - ClientName: "dead-tooter", - RedirectUris: "urn:ietf:wg:oauth:2.0:oob", - Scopes: "read write follow push", - Website: "https://dead-tooter.vexingworkshop.com", - }.Create() + app := mastodon.Application{} + err := app.Load("dead-tooter") + /* + app, err := mastodon.App{ + ClientName: "dead-tooter", + RedirectUris: "urn:ietf:wg:oauth:2.0:oob", + Scopes: "read write follow push", + Website: "https://dead-tooter.vexingworkshop.com", + }.Create() + */ if err != nil { panic(err.Error()) } - app.Save() + //app.Save() fmt.Printf("%v", app) diff --git a/pkg/mastodon/application.go b/pkg/mastodon/application.go index b006480..d5cf67b 100644 --- a/pkg/mastodon/application.go +++ b/pkg/mastodon/application.go @@ -42,7 +42,7 @@ func (a Application) Save() { // Load will hydrate an Application instance based upon data stored in // a file. -func (a Application) Load(name string) error { +func (a *Application) Load(name string) error { data, err := os.ReadFile(configdir + name) if err != nil && os.IsNotExist(err) { panic(err.Error())