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 ( import (
"fmt" "fmt"
"io" "io"
"log"
"os" "os"
) )
func main() { func main() {
n, err := transfer() n, err := transfer()
if err != nil { if err != nil {
log.Fatal(err) fmt.Fprintln(os.Stderr, err)
return
} }
fmt.Printf("%d bytes transferred.\n", n) fmt.Printf("%d bytes transferred.\n", n)
} }