Remove dependency of deprecated ioutil package
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user