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

chore: replace deprecated functions #694

Merged
merged 3 commits into from
Oct 5, 2022
Merged

Conversation

zemyblue
Copy link
Member

@zemyblue zemyblue commented Oct 4, 2022

Description

Replace deprecated functions since go 1.16 or 1.17.

  • ioutil.ReadFile -> os.ReadFile
  • ioutil.ReadAll -> io.ReadAll
  • ioutil.TempDir -> os.MkdirTemp
  • ioutil.WriteFile -> os.WriteFile
  • ioutil.NopCloser -> io.NopCloser
  • ioutil.Discard -> io.Discard
  • ioutil.TempFile -> os.CreateTemp
  • ioutil.Discard -> io.Discard
  • ioutil.ReadDir -> os.ReadDir

Motivation and context

The io/ioutil has been deprecated since Go 1.16.

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

* ioutil.ReadFile -> os.ReadFile
* ioutil.ReadAll -> io.ReadAll
* ioutil.TempDir -> os.MkdirTemp
* ioutil.WriteFile -> os.WriteFile
* ioutil.NopCloser -> io.NopCloser
* ioutil.Discard -> io.Discard
* ioutil.TempFile -> os.CreateTemp
* ioutil.Discard -> io.Discard
* ioutil.ReadDir -> os.ReadDir

Signed-off-by: zemyblue <zemyblue@gmail.com>
@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Merging #694 (6b7951e) into main (551bc1c) will decrease coverage by 0.01%.
The diff coverage is 64.15%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #694      +/-   ##
==========================================
- Coverage   61.15%   61.14%   -0.02%     
==========================================
  Files         873      873              
  Lines       98421    98432      +11     
==========================================
- Hits        60192    60182      -10     
- Misses      34644    34670      +26     
+ Partials     3585     3580       -5     
Impacted Files Coverage Δ
crypto/keyring/keyring.go 59.55% <0.00%> (ø)
simapp/state.go 0.00% <0.00%> (ø)
simapp/utils.go 21.62% <0.00%> (ø)
testutil/rest.go 0.00% <0.00%> (ø)
x/auth/client/cli/tx_multisign.go 0.00% <0.00%> (ø)
x/genutil/client/cli/gentx.go 0.00% <0.00%> (ø)
x/params/client/utils/utils.go 47.61% <0.00%> (ø)
x/simulation/event_stats.go 0.00% <0.00%> (ø)
x/wasm/client/cli/query.go 0.00% <0.00%> (ø)
types/rest/rest.go 76.01% <33.33%> (ø)
... and 21 more

Signed-off-by: zemyblue <zemyblue@gmail.com>
@zemyblue zemyblue self-assigned this Oct 4, 2022
Signed-off-by: zemyblue <zemyblue@gmail.com>
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.

3 participants