Skip to content

_examples: remove deprecated usage of io/ioutil#2046

Merged
pjbgf merged 1 commit into
go-git:mainfrom
alexandear-org:remove-ioutil-examples
May 1, 2026
Merged

_examples: remove deprecated usage of io/ioutil#2046
pjbgf merged 1 commit into
go-git:mainfrom
alexandear-org:remove-ioutil-examples

Conversation

@alexandear

Copy link
Copy Markdown
Contributor

io/ioutil is deprecated:

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.

Copilot AI review requested due to automatic review settings April 30, 2026 11:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the restore example to avoid the deprecated io/ioutil package by switching to modern os APIs, keeping the example compatible with current Go best practices.

Changes:

  • Remove io/ioutil import from the restore example.
  • Replace ioutil.WriteFile calls with os.WriteFile.

@alexandear alexandear force-pushed the remove-ioutil-examples branch from 0a72c7e to 83fcf5d Compare April 30, 2026 11:13

@pjbgf pjbgf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexandear thanks for working on this. 🙇

@pjbgf pjbgf merged commit f4c666c into go-git:main May 1, 2026
17 checks passed
@alexandear alexandear deleted the remove-ioutil-examples branch May 1, 2026 12: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.

3 participants