Remove dependency of deprecated ioutil package

This commit is contained in:
Deluan
2021-07-20 20:00:58 -04:00
parent 774ad65155
commit 8afa2cd833
23 changed files with 77 additions and 86 deletions
+1 -2
View File
@@ -5,7 +5,6 @@ import (
"context"
"errors"
"io"
"io/ioutil"
"net/http/httptest"
"github.com/navidrome/navidrome/model"
@@ -76,5 +75,5 @@ func (c *fakeArtwork) Get(ctx context.Context, id string, size int) (io.ReadClos
}
c.recvId = id
c.recvSize = size
return ioutil.NopCloser(bytes.NewReader([]byte(c.data))), nil
return io.NopCloser(bytes.NewReader([]byte(c.data))), nil
}
+1 -2
View File
@@ -3,7 +3,6 @@ package subsonic
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"strconv"
"strings"
@@ -67,7 +66,7 @@ func (c *StreamController) Stream(w http.ResponseWriter, r *http.Request) (*resp
}
if r.Method == "HEAD" {
go func() { _, _ = io.Copy(ioutil.Discard, stream) }()
go func() { _, _ = io.Copy(io.Discard, stream) }()
} else {
if c, err := io.Copy(w, stream); err != nil {
log.Error(ctx, "Error sending transcoded file", "id", id, err)