Proxy: Replace deprecated io/ioutil with io package

The io/ioutil package has been deprecated since Go 1.16. Replace all
usages with their io package equivalents:

- ioutil.ReadAll -> io.ReadAll
- ioutil.Discard -> io.Discard

Files changed:
- internal/utils/utils.go
- internal/logger/log.go
- internal/protocol/rtc.go
- internal/protocol/http.go
This commit is contained in:
shiweikang 2026-04-11 12:44:49 +08:00 committed by Jacob Su
parent 913b773282
commit 737d4960f0

View File

@ -9,7 +9,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"strconv"
@ -224,7 +223,7 @@ func (v *webRTCProxyServer) proxyApiToBackend(
}
// Parse the local SDP answer from backend.
b, err := ioutil.ReadAll(resp.Body)
b, err := io.ReadAll(resp.Body)
if err != nil {
return errors.Wrapf(err, "read stream from %v", backendURL)
}