ioutil
This commit is contained in:
parent
a4d8bfab6a
commit
55d4a4de5b
@ -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")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user