From 7d6dc05de1c833998dc9219278ae26d7746a2177 Mon Sep 17 00:00:00 2001 From: mksafavi Date: Sun, 15 Sep 2024 22:10:47 +0330 Subject: replaced the deprecated ioutil.ReadAll with io.ReadAll --- music/patch.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/music/patch.go b/music/patch.go index aba20ec..7b3302d 100644 --- a/music/patch.go +++ b/music/patch.go @@ -4,7 +4,6 @@ import ( "encoding/xml" "fmt" "io" - "io/ioutil" "net/url" "strings" @@ -26,7 +25,7 @@ func Stream2(s *subsonic.Client, id string, parameters map[string]string) (io.Re contentType := response.Header.Get("Content-Type") if strings.HasPrefix(contentType, "text/xml") || strings.HasPrefix(contentType, "application/xml") { // An error was returned - responseBody, err := ioutil.ReadAll(response.Body) + responseBody, err := io.ReadAll(response.Body) if err != nil { return nil, err } @@ -56,7 +55,7 @@ func Download2(s *subsonic.Client, id string) (io.ReadCloser, error) { contentType := response.Header.Get("Content-Type") if strings.HasPrefix(contentType, "text/xml") || strings.HasPrefix(contentType, "application/xml") { // An error was returned - responseBody, err := ioutil.ReadAll(response.Body) + responseBody, err := io.ReadAll(response.Body) if err != nil { return nil, err } -- cgit v1.2.3