mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
cleanup: use os.ReadFile to read file
as ioutil.ReadFile is deprecated and suggestion is to use os.ReadFile as per https://pkg.go.dev/io/ioutil updating the same. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
562dff0d19
commit
aba6979d29
@ -18,7 +18,7 @@ package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -96,7 +96,7 @@ func (cp *ConnPool) Destroy() {
|
||||
|
||||
func (cp *ConnPool) generateUniqueKey(monitors, user, keyfile string) (string, error) {
|
||||
// the keyfile can be unique for operations, contents will be the same
|
||||
key, err := ioutil.ReadFile(keyfile) // #nosec:G304, file inclusion via variable.
|
||||
key, err := os.ReadFile(keyfile) // #nosec:G304, file inclusion via variable.
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("could not open keyfile %s: %w", keyfile, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user