This commit is contained in:
a 2023-01-18 23:12:13 -06:00
parent a4d8bfab6a
commit 55d4a4de5b

View File

@ -3,6 +3,7 @@ package auth
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io"
"io/ioutil" "io/ioutil"
"log" "log"
"net/http" "net/http"
@ -63,7 +64,7 @@ func GetClient(ctx *gctx.Context) (*spotify.Client, error) {
return nil, err return nil, err
} }
defer authFile.Close() defer authFile.Close()
authValue, err := ioutil.ReadAll(authFile) authValue, err := io.ReadAll(authFile)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -82,7 +83,7 @@ func GetClient(ctx *gctx.Context) (*spotify.Client, error) {
if err != nil { if err != nil {
panic(err.Error()) panic(err.Error())
} }
err = ioutil.WriteFile(filepath.Join(configDir, "gospt/auth.json"), out, 0o644) err = os.WriteFile(filepath.Join(configDir, "gospt/auth.json"), out, 0o644)
if err != nil { if err != nil {
panic("FAILED TO SAVE AUTH") panic("FAILED TO SAVE AUTH")
} }
@ -91,7 +92,7 @@ func GetClient(ctx *gctx.Context) (*spotify.Client, error) {
if err != nil { if err != nil {
panic(err.Error()) panic(err.Error())
} }
err = ioutil.WriteFile(filepath.Join(configDir, "gospt/auth.json"), out, 0o644) err = os.WriteFile(filepath.Join(configDir, "gospt/auth.json"), out, 0o644)
if err != nil { if err != nil {
panic("FAILED TO SAVE AUTH") panic("FAILED TO SAVE AUTH")
} }