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 (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
@ -63,7 +64,7 @@ func GetClient(ctx *gctx.Context) (*spotify.Client, error) {
return nil, err
}
defer authFile.Close()
authValue, err := ioutil.ReadAll(authFile)
authValue, err := io.ReadAll(authFile)
if err != nil {
return nil, err
}
@ -82,7 +83,7 @@ func GetClient(ctx *gctx.Context) (*spotify.Client, error) {
if err != nil {
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 {
panic("FAILED TO SAVE AUTH")
}
@ -91,7 +92,7 @@ func GetClient(ctx *gctx.Context) (*spotify.Client, error) {
if err != nil {
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 {
panic("FAILED TO SAVE AUTH")
}