From c814efc1642a1e69139810764fa9e280e0214b09 Mon Sep 17 00:00:00 2001 From: gutmet Date: Sun, 20 Nov 2022 22:59:17 +0100 Subject: [PATCH] maybe as params? --- accounts.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/accounts.go b/accounts.go index 730e7c8..9fce5c3 100644 --- a/accounts.go +++ b/accounts.go @@ -56,8 +56,10 @@ type AccountSource struct { } func LookupAccount(username string) (*Account, error) { + params := url.Values{} + params.Set("acct", username) var account Account - err := doAPI(http.MethodGet, fmt.Sprintf("/api/v1/accounts/lookup?acct=%s", url.QueryEscape(username)), nil, &account, nil) + err := doAPI(http.MethodGet, fmt.Sprintf("/api/v1/accounts/lookup"), params, &account, nil) if err != nil { return nil, err } @@ -74,7 +76,6 @@ func GetAccount(id ID) (*Account, error) { } func GetCurrentAccount() (*Account, error) { - checkInit() var account Account err := doAPI(http.MethodGet, "/api/v1/accounts/verify_credentials", nil, &account, nil) if err != nil {