Skip to content

fix: replace deprecated io/ioutil and rand.Seed with modern Go equivalents#211

Open
ramonskie wants to merge 1 commit intomasterfrom
fix/remove-ioutil-deprecations
Open

fix: replace deprecated io/ioutil and rand.Seed with modern Go equivalents#211
ramonskie wants to merge 1 commit intomasterfrom
fix/remove-ioutil-deprecations

Conversation

@ramonskie
Copy link
Contributor

Summary

  • Replaces all deprecated io/ioutil function calls with their modern os.* / io.* equivalents (available since Go 1.16, deprecated since Go 1.16)
  • Removes deprecated rand.Seed() calls (deprecated since Go 1.20); SeedRandom() in cutlass helpers is preserved as a no-op for API compatibility
  • All 35 first-party source files updated; vendor directory untouched

Replacements

Deprecated Modern
ioutil.ReadFile() os.ReadFile()
ioutil.WriteFile() os.WriteFile()
ioutil.ReadDir() os.ReadDir()
ioutil.TempDir() os.MkdirTemp()
ioutil.TempFile() os.CreateTemp()
ioutil.ReadAll() io.ReadAll()
ioutil.Discard io.Discard
rand.Seed(time.Now().UnixNano()) removed

Testing

go build ./... and go test ./... both pass cleanly.

…lents

All ioutil.* calls replaced with os.* / io.* equivalents (available since Go 1.16):
- ioutil.ReadFile  → os.ReadFile
- ioutil.WriteFile → os.WriteFile
- ioutil.ReadDir   → os.ReadDir (DirEntry API updated where .Mode()/.Size() used)
- ioutil.TempDir   → os.MkdirTemp
- ioutil.TempFile  → os.CreateTemp
- ioutil.ReadAll   → io.ReadAll
- ioutil.Discard   → io.Discard

Removed deprecated rand.Seed(time.Now().UnixNano()) from util.go init()
and rand.Seed calls from cutlass/test_helpers.go and cutlass/v7/test_helpers.go
SeedRandom() preserved as a no-op for API compatibility.
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