chore: remove deprecated "io/ioutil" imports (#25119)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
@@ -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")
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user