Skip to content

Proxy: Replace deprecated io/ioutil with io package#4660

Open
sevico wants to merge 1 commit into
ossrs:developfrom
sevico:fix/replace-deprecated-ioutil
Open

Proxy: Replace deprecated io/ioutil with io package#4660
sevico wants to merge 1 commit into
ossrs:developfrom
sevico:fix/replace-deprecated-ioutil

Conversation

@sevico

@sevico sevico commented Apr 11, 2026

Copy link
Copy Markdown

Summary

The io/ioutil package has been deprecated since Go 1.16. This PR replaces all usages across the proxy codebase with their io package equivalents:

  • ioutil.ReadAll -> io.ReadAll
  • ioutil.Discard -> io.Discard
  • Remove "io/ioutil" imports

Files Changed

  • internal/utils/utils.go
  • internal/logger/log.go
  • internal/protocol/rtc.go
  • internal/protocol/http.go

Note

The comment example in internal/errors/errors.go (line 20) still references ioutil.ReadAll as it is third-party documentation text and not actual code.

@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Apr 11, 2026
@winlinvip winlinvip force-pushed the develop branch 3 times, most recently from 6ce415e to 6ee6f1c Compare May 17, 2026 16:09
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
@suzp1984 suzp1984 force-pushed the fix/replace-deprecated-ioutil branch from 2d01dfb to 737d496 Compare May 19, 2026 06:53

@suzp1984 suzp1984 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve.

  1. Rebased to develop branch.
  2. The develop branch already replace the io/ioutil to io, but missing rtc.go, so this PR still valuable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EnglishNative This issue is conveyed exclusively in English.

Development

Successfully merging this pull request may close these issues.

3 participants