aboutsummaryrefslogtreecommitdiff
path: root/ssh/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'ssh/example_test.go')
-rw-r--r--ssh/example_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/ssh/example_test.go b/ssh/example_test.go
index 8a0aaef..bee6796 100644
--- a/ssh/example_test.go
+++ b/ssh/example_test.go
@@ -8,7 +8,6 @@ import (
"bufio"
"bytes"
"fmt"
- "io/ioutil"
"log"
"net"
"net/http"
@@ -24,7 +23,7 @@ func ExampleNewServerConn() {
// Public key authentication is done by comparing
// the public key of a received connection
// with the entries in the authorized_keys file.
- authorizedKeysBytes, err := ioutil.ReadFile("authorized_keys")
+ authorizedKeysBytes, err := os.ReadFile("authorized_keys")
if err != nil {
log.Fatalf("Failed to load authorized_keys, err: %v", err)
}
@@ -67,7 +66,7 @@ func ExampleNewServerConn() {
},
}
- privateBytes, err := ioutil.ReadFile("id_rsa")
+ privateBytes, err := os.ReadFile("id_rsa")
if err != nil {
log.Fatal("Failed to load private key: ", err)
}
@@ -225,7 +224,7 @@ func ExamplePublicKeys() {
//
// If you have an encrypted private key, the crypto/x509 package
// can be used to decrypt it.
- key, err := ioutil.ReadFile("/home/user/.ssh/id_rsa")
+ key, err := os.ReadFile("/home/user/.ssh/id_rsa")
if err != nil {
log.Fatalf("unable to read private key: %v", err)
}