Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace io/ioutil package #2342

Merged
merged 1 commit into from Nov 21, 2022
Merged

Conversation

zeek0x
Copy link
Contributor

@zeek0x zeek0x commented Nov 21, 2022

"io/ioutil" package has been deprecated since Go 1.16.

This does not indicate that the package will be broken in the future, but analysis tools such as staticcheck will recognize it as a target for modification, thus burying the analysis to be fixed.

$ git --no-pager grep ioutil
$
staticcheck-before
echo.go:46:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
echo_test.go:10:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
group_test.go:4:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
middleware/body_dump.go:7:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
middleware/body_dump_test.go:5:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
middleware/body_limit_test.go:5:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
middleware/compress.go:7:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
middleware/compress_test.go:7:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
middleware/decompress_test.go:7:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
middleware/jwt.go:265:2: this value of token is never used (SA4006)
middleware/proxy_test.go:7:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
middleware/proxy_test.go:387:2: this value of rec is never used (SA4006)
middleware/rewrite_test.go:4:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
middleware/timeout_test.go:8:2: "io/ioutil" has been deprecated since Go 1.16: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.  (SA1019)
middleware/timeout_test.go:132:34: should use make(chan struct{}) instead (S1019)
middleware/timeout_test.go:248:34: should use make(chan struct{}) instead (S1019)
middleware/timeout_test.go:278:34: should use make(chan struct{}) instead (S1019)
staticcheck-after
middleware/jwt.go:265:2: this value of token is never used (SA4006)
middleware/proxy_test.go:387:2: this value of rec is never used (SA4006)
middleware/timeout_test.go:132:34: should use make(chan struct{}) instead (S1019)
middleware/timeout_test.go:248:34: should use make(chan struct{}) instead (S1019)
middleware/timeout_test.go:278:34: should use make(chan struct{}) instead (S1019)

"io/ioutil" pakcage has been deprecated since Go 1.16.
@zeek0x zeek0x changed the title Replace io/ioutil packaeg Replace io/ioutil package Nov 21, 2022
@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Base: 92.37% // Head: 92.38% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (506924f) compared to base (fd2b102).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2342      +/-   ##
==========================================
+ Coverage   92.37%   92.38%   +0.01%     
==========================================
  Files          37       37              
  Lines        4448     4454       +6     
==========================================
+ Hits         4109     4115       +6     
  Misses        247      247              
  Partials       92       92              
Impacted Files Coverage Δ
echo.go 95.24% <100.00%> (+0.06%) ⬆️
middleware/body_dump.go 90.47% <100.00%> (ø)
middleware/compress.go 81.15% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@aldas aldas merged commit 3c4d3b3 into labstack:master Nov 21, 2022
@aldas
Copy link
Contributor

aldas commented Nov 21, 2022

Thank you

@zeek0x zeek0x deleted the refactor/replace-ioutil branch November 22, 2022 00:40
@aldas aldas mentioned this pull request Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants