ioutil: Switch away from deprecated package

ioutil has been deprecated since golang 1.16.
This commit uses the replacement methods from the os or io packages.
This should fix some golangci-lint CI failures.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Christophe Fergeau
2022-09-01 14:36:34 +02:00
committed by Anjan Nath
parent 89efd2bdb9
commit 8c72b59df3
8 changed files with 15 additions and 19 deletions

View File

@@ -2,8 +2,8 @@ package main
import (
"fmt"
"io/ioutil"
"net"
"os"
"time"
"golang.org/x/crypto/ssh"
@@ -27,7 +27,7 @@ func newClient(conn net.Conn, user string, key string) (*client, error) {
}
func newConfig(user string, keyFile string) (*ssh.ClientConfig, error) {
key, err := ioutil.ReadFile(keyFile)
key, err := os.ReadFile(keyFile)
if err != nil {
return nil, err
}