Skip to content

Replace deprecated io/ioutil with modern os/io equivalents#1112

Merged
ramonskie merged 1 commit intomasterfrom
fix/remove-ioutil-deprecations
Mar 5, 2026
Merged

Replace deprecated io/ioutil with modern os/io equivalents#1112
ramonskie merged 1 commit intomasterfrom
fix/remove-ioutil-deprecations

Conversation

@ramonskie
Copy link
Contributor

Summary

  • Replaces all ioutil.ReadFile, WriteFile, ReadDir, TempDir, TempFile, ReadAll, and Discard calls with their Go 1.16+ equivalents in the os and io packages
  • Fixes []os.FileInfo[]os.DirEntry for all os.ReadDir callers (finalize.go)
  • Removes the io/ioutil import from all affected files

Motivation

io/ioutil was deprecated in Go 1.16. All buildpacks now target Go 1.24.x, so these modern replacements are fully supported.

Related

Part of a series of identical PRs across all CF buildpacks and libbuildpack (see cloudfoundry/libbuildpack#211).

Replaces all ioutil.ReadFile, WriteFile, ReadDir, TempDir, TempFile,
ReadAll and Discard calls with their Go 1.16+ replacements in os and io
packages. Also fixes []os.FileInfo -> []os.DirEntry for ReadDir callers.
@ramonskie ramonskie merged commit 1d6ed23 into master Mar 5, 2026
6 checks passed
@ramonskie ramonskie deleted the fix/remove-ioutil-deprecations branch March 5, 2026 14:49
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.

1 participant