Skip to content

Commit

Permalink
Merge pull request #560 from urko-b/fix-server-example
Browse files Browse the repository at this point in the history
fix: remove ioutil and use io/os libraries
  • Loading branch information
puellanivis committed Oct 24, 2023
2 parents 3a25fef + d6dd372 commit b0487bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions examples/go-sftp-server/main.go
Expand Up @@ -7,7 +7,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"os"
Expand All @@ -28,7 +27,7 @@ func main() {
flag.BoolVar(&debugStderr, "e", false, "debug to stderr")
flag.Parse()

debugStream := ioutil.Discard
debugStream := io.Discard
if debugStderr {
debugStream = os.Stderr
}
Expand All @@ -47,7 +46,7 @@ func main() {
},
}

privateBytes, err := ioutil.ReadFile("id_rsa")
privateBytes, err := os.ReadFile("id_rsa")
if err != nil {
log.Fatal("Failed to load private key", err)
}
Expand Down
5 changes: 2 additions & 3 deletions examples/request-server/main.go
Expand Up @@ -7,7 +7,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"os"
Expand All @@ -28,7 +27,7 @@ func main() {
flag.BoolVar(&debugStderr, "e", false, "debug to stderr")
flag.Parse()

debugStream := ioutil.Discard
debugStream := io.Discard
if debugStderr {
debugStream = os.Stderr
}
Expand All @@ -47,7 +46,7 @@ func main() {
},
}

privateBytes, err := ioutil.ReadFile("id_rsa")
privateBytes, err := os.ReadFile("id_rsa")
if err != nil {
log.Fatal("Failed to load private key", err)
}
Expand Down

0 comments on commit b0487bc

Please sign in to comment.