chore: Replace deprecated io/ioutil functions with recommended alternatives (#9542)

# Which Problems Are Solved

- The `io/ioutil` package was deprecated in Go 1.16.  
  - Reference: https://go.dev/doc/go1.16#ioutil  

# How the Problems Are Solved

- Replaced deprecated functions with their recommended alternatives:  
  - `ioutil.ReadFile` → `os.ReadFile`  
  - `ioutil.ReadAll` → `io.ReadAll`  
  - `ioutil.NopCloser` → `io.NopCloser`
This commit is contained in:
Kenta Yamaguchi
2025-03-17 22:17:14 +09:00
committed by GitHub
parent 19f022e1cf
commit d57fa819cb
6 changed files with 16 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"os"
"time"
@@ -320,7 +320,7 @@ func (q *Queries) readTranslationFile(namespace i18n.Namespace, filename string)
if err != nil {
return nil, zerrors.ThrowInternal(err, "QUERY-93njw", "Errors.TranslationFile.ReadError")
}
contents, err := ioutil.ReadAll(r)
contents, err := io.ReadAll(r)
if err != nil {
return nil, zerrors.ThrowInternal(err, "QUERY-l0fse", "Errors.TranslationFile.ReadError")
}