add deps to makefile fix gitignore remove deprecated ioutil #3
@ -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")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user