From 07c2517ec0fd1973abddcf34072d69d8fc6e9a8f Mon Sep 17 00:00:00 2001 From: Adam Shamblin Date: Tue, 6 Dec 2022 00:22:09 -0700 Subject: [PATCH] fix missing pointer --- main.go | 20 +++++++++++--------- pkg/mastodon/application.go | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) 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()) -- 2.39.5