alibaba / open-local

cloud-native local storage management system for stateful workload, low-latency with simplicity
Apache License 2.0
460 stars 81 forks source link

Replace deprecation ioutil fucntions #240

Closed dongjiang1989 closed 9 months ago

dongjiang1989 commented 9 months ago

Go 1.16 deprecated several io/ioutil functions.

ioutil.ReadFile -> os.ReadFile ioutil.ReadAll -> io.ReadAll ioutil.ReadDir -> os.ReadDir

Deprecated: 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.

ref: https://pkg.go.dev/io/ioutil

codecov-commenter commented 9 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (4e7d041) 32.42% compared to head (695264a) 32.38%.

Files Patch % Lines
pkg/agent/discovery/device.go 0.00% 1 Missing :warning:
pkg/agent/discovery/mountpoint.go 0.00% 1 Missing :warning:
pkg/csi/nodeutils.go 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #240 +/- ## ========================================== - Coverage 32.42% 32.38% -0.05% ========================================== Files 41 41 Lines 6411 6411 ========================================== - Hits 2079 2076 -3 - Misses 4043 4045 +2 - Partials 289 290 +1 ``` | [Flag](https://app.codecov.io/gh/alibaba/open-local/pull/240/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/alibaba/open-local/pull/240/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba) | `32.38% <0.00%> (-0.05%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=alibaba#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dongjiang1989 commented 9 months ago

@peter-wangxu addressed comments, please review :)

peter-wangxu commented 9 months ago

LGTM