matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Deprecated ioutil package usage throughout codebase

Open andrinoff opened this issue 7 months ago • 1 comments

Describe the bug Multiple files use deprecated ioutil package (deprecated since Go 1.16). Should migrate to io and os package equivalents.

To reproduce Examine fetcher/fetcher.go usage:

  • Line 137: ioutil.ReadAll() → use io.ReadAll()
  • Line 152: ioutil.ReadAll() → use io.ReadAll()
  • Line 184: ioutil.ReadAll() → use io.ReadAll()
  • Line 186: ioutil.ReadAll() → use io.ReadAll()
  • Line 740: ioutil.ReadAll() → use io.ReadAll()

Expected behavior Replace deprecated ioutil functions:

  • ioutil.ReadAll() → io.ReadAll()
  • ioutil.ReadFile() → os.ReadFile()
  • ioutil.WriteFile() → os.WriteFile()
  • ioutil.TempDir() → os.MkdirTemp()
  • ioutil.TempFile() → os.CreateTemp()

Additional context

  • Good first issue: mechanical find-replace upgrade
  • Deprecated since Go 1.16 (2021)
  • No functional change - new functions are direct equivalents
  • Modern go.mod likely requires Go 1.18+
  • Related to issue #713 (which also needs ioutil→io migration)

Suggested fix:

- import "io/ioutil"
+ import "io"

- body, err := ioutil.ReadAll(reader)
+ body, err := io.ReadAll(reader)

OS All platforms

andrinoff avatar Apr 21 '26 09:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 22 '26 06:05 floatpanebot