chore: remove deprecated "io/ioutil" imports (#25119)

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
Aldrin
2023-11-16 16:45:30 +05:30
коммит произвёл GitHub
родитель afb48219c0
Коммит 2ff946e79b
17 изменённых файлов: 54 добавлений и 64 удалений

Просмотреть файл

@@ -8,7 +8,6 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
@@ -158,8 +157,8 @@ func processProfileImagesDir(profileImagesPath, tmpDir, bulk string) ([]string,
if !profileImagesStat.IsDir() {
return nil, fmt.Errorf("profile-images parameters must be a directory")
}
var profileImagesFiles []os.FileInfo
profileImagesFiles, err = ioutil.ReadDir(profileImagesPath)
profileImagesFiles, err := os.ReadDir(profileImagesPath)
if err != nil {
return nil, fmt.Errorf("invalid profile-images parameter: %w", err)
}
@@ -223,7 +222,7 @@ func sampledataCmdF(c client.Client, command *cobra.Command, args []string) erro
var err error
switch bulk {
case "":
tmpDir, err = ioutil.TempDir("", "mmctl-sampledata-")
tmpDir, err = os.MkdirTemp("", "mmctl-sampledata-")
if err != nil {
return fmt.Errorf("unable to create temporary directory")
}