Skip to content

Commit

Permalink
Use log instead of fmt for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cskr committed Jun 21, 2013
1 parent 388ef8a commit b4532f2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gorepos.go
Expand Up @@ -21,6 +21,7 @@ import (
"flag"
"fmt"
"io"
"log"
"net/http"
"os"
"strings"
Expand All @@ -45,15 +46,13 @@ func main() {

pl, err := NewPackageList(*pkgFile)
if err != nil {
fmt.Fprintln(os.Stderr, "Reading package list failed:", err)
os.Exit(2)
log.Fatalln("Reading package list failed:", err)
}

fmt.Printf("Serving package(s) on %s...\n", *addr)
err = http.ListenAndServe(*addr, pl)
if err != nil {
fmt.Fprintln(os.Stderr, "Server failed to start:", err)
os.Exit(3)
log.Fatalln("Server failed to start:", err)
}
}

Expand Down

0 comments on commit b4532f2

Please sign in to comment.