refactor: handle err with fprintln io reusable ifaces

This commit is contained in:
Inanc Gumus
2019-11-08 11:02:57 +03:00
parent 81adab6690
commit cf66e4b720

View File

@ -11,14 +11,14 @@ package main
import (
"fmt"
"io"
"log"
"os"
)
func main() {
n, err := transfer()
if err != nil {
log.Fatal(err)
fmt.Fprintln(os.Stderr, err)
return
}
fmt.Printf("%d bytes transferred.\n", n)
}