diff options
author | mksafavi <mksafavi@gmail.com> | 2024-09-15 22:10:47 +0330 |
---|---|---|
committer | Simon Garrelou <simon@sixfoisneuf.fr> | 2024-09-22 09:54:26 +0200 |
commit | 7d6dc05de1c833998dc9219278ae26d7746a2177 (patch) | |
tree | 5d5f7946af92b7b423fe7dd8d8d5938dd6d51818 /music | |
parent | 248c50d0a64a569ccbb396434c9e3389316a9adb (diff) | |
download | termsonic-7d6dc05de1c833998dc9219278ae26d7746a2177.tar.gz termsonic-7d6dc05de1c833998dc9219278ae26d7746a2177.zip |
replaced the deprecated ioutil.ReadAll with io.ReadAll
Diffstat (limited to 'music')
-rw-r--r-- | music/patch.go | 5 |
1 files 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 ( | |||
4 | "encoding/xml" | 4 | "encoding/xml" |
5 | "fmt" | 5 | "fmt" |
6 | "io" | 6 | "io" |
7 | "io/ioutil" | ||
8 | "net/url" | 7 | "net/url" |
9 | "strings" | 8 | "strings" |
10 | 9 | ||
@@ -26,7 +25,7 @@ func Stream2(s *subsonic.Client, id string, parameters map[string]string) (io.Re | |||
26 | contentType := response.Header.Get("Content-Type") | 25 | contentType := response.Header.Get("Content-Type") |
27 | if strings.HasPrefix(contentType, "text/xml") || strings.HasPrefix(contentType, "application/xml") { | 26 | if strings.HasPrefix(contentType, "text/xml") || strings.HasPrefix(contentType, "application/xml") { |
28 | // An error was returned | 27 | // An error was returned |
29 | responseBody, err := ioutil.ReadAll(response.Body) | 28 | responseBody, err := io.ReadAll(response.Body) |
30 | if err != nil { | 29 | if err != nil { |
31 | return nil, err | 30 | return nil, err |
32 | } | 31 | } |
@@ -56,7 +55,7 @@ func Download2(s *subsonic.Client, id string) (io.ReadCloser, error) { | |||
56 | contentType := response.Header.Get("Content-Type") | 55 | contentType := response.Header.Get("Content-Type") |
57 | if strings.HasPrefix(contentType, "text/xml") || strings.HasPrefix(contentType, "application/xml") { | 56 | if strings.HasPrefix(contentType, "text/xml") || strings.HasPrefix(contentType, "application/xml") { |
58 | // An error was returned | 57 | // An error was returned |
59 | responseBody, err := ioutil.ReadAll(response.Body) | 58 | responseBody, err := io.ReadAll(response.Body) |
60 | if err != nil { | 59 | if err != nil { |
61 | return nil, err | 60 | return nil, err |
62 | } | 61 | } |