cncf-tags / container-device-interface

Apache License 2.0
190 stars 36 forks source link

chore: stop using deprecated io/ioutil package #180

Closed marquiz closed 5 months ago

marquiz commented 5 months ago

Replace with corresponding functions from io and os packages.

elezar commented 5 months ago

@marquiz as a test I ran golangci-lint over the codebase and noted:

schema/schema.go:25:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: 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. (staticcheck)
        "io/ioutil"
        ^
pkg/cdi/spec.go:22:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: 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. (staticcheck)
        "io/ioutil"
        ^
pkg/cdi/spec-dirs_test.go:21:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: 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. (staticcheck)
        "io/ioutil"
        ^

Does it make sense to enable this as a follow up as well?

marquiz commented 5 months ago

Let's consider adding golangci-lint as a follow-up.

Yes, definitely will make sense