From 55d4a4de5b6b303a4b111a4c969e2b3844c2219c Mon Sep 17 00:00:00 2001 From: a Date: Wed, 18 Jan 2023 23:12:13 -0600 Subject: [PATCH] ioutil --- src/auth/auth.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/auth/auth.go b/src/auth/auth.go index 07ce019..fb1cdc8 100644 --- a/src/auth/auth.go +++ b/src/auth/auth.go @@ -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") }