0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Go言語] ioutilを使うのはやめよう

Last updated at Posted at 2025-02-26

はじめに

こんにちは、Go言語初学者です。
APIを叩いてレスポンスを取得しようとした際に、ioutilというライブラリを用いて記述すると、vscodeで警告がでました。

どうやらioutilのアップデートが止まっており、公式でも別のモジュールを推奨しています。
内部構造までは追えていませんが、現時点でもioutilを使用されている方はリファクタリングをしてみてください。

実装方法

今まで書いていたioutilの記法を以下のように変更することで解決出来ます。

スクリーンショット 2025-02-26 18.46.05.png

参考記事

最後に

今回はioutilを使わずに書く方法をまとめました。
github copilotやchatgpt等のAIはまだまだioではなくioutilで書かせてくるので、気をつけましょう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?