From 0ecbb8d58cbf81c92ae648ce3e2cf975147dd9e1 Mon Sep 17 00:00:00 2001 From: gohumble Date: Sun, 12 Jun 2022 21:03:37 +0200 Subject: [PATCH] fix naming --- internal/lnbits/lnbits.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/lnbits/lnbits.go b/internal/lnbits/lnbits.go index e67fb3d..fd743c0 100644 --- a/internal/lnbits/lnbits.go +++ b/internal/lnbits/lnbits.go @@ -44,7 +44,7 @@ func (c *Client) GetUser(userId string) (user User, err error) { } // CreateUserWithInitialWallet creates new user with initial wallet -func (c *Client) CreateUserWithInitialWallet(userName, walletName, adminId string, email string) (wal User, err error) { +func (c *Client) CreateUserWithInitialWallet(userName, walletName, adminId string, email string) (user User, err error) { resp, err := req.Post(c.url+"/usermanager/api/v1/users", c.header, req.BodyJSON(struct { WalletName string `json:"wallet_name"` AdminId string `json:"admin_id"` @@ -61,14 +61,14 @@ func (c *Client) CreateUserWithInitialWallet(userName, walletName, adminId strin err = reqErr return } - err = resp.ToJSON(&wal) + err = resp.ToJSON(&user) res := gjson.Get(resp.String(), "wallets.0") if res.Index == 0 { err = fmt.Errorf("could not create initial wallet") return } - wal.Wallet = &Wallet{} - err = json.Unmarshal([]byte(res.Raw), wal.Wallet) + user.Wallet = &Wallet{} + err = json.Unmarshal([]byte(res.Raw), user.Wallet) return }