Skip to content

Commit 1fadf6b

Browse files
committed
devapp: check for error from s.initCorpus
Also remove superfluous newlines from log strings. Change-Id: I2e0fb408f40e47af3f6ea5149113722b3e1db114 Reviewed-on: https://go-review.googlesource.com/127675 Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent ec760fd commit 1fadf6b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

devapp/devapp.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,16 @@ func main() {
4848

4949
s := newServer(http.NewServeMux(), *staticDir, *templateDir)
5050
ctx := context.Background()
51-
s.initCorpus(ctx)
51+
if err := s.initCorpus(ctx); err != nil {
52+
log.Fatalf("Could not init corpus: %v", err)
53+
}
5254
go s.corpusUpdateLoop(ctx)
5355

5456
ln, err := net.Listen("tcp", *listen)
5557
if err != nil {
56-
log.Fatalf("Error listening on %s: %v\n", *listen, err)
58+
log.Fatalf("Error listening on %s: %v", *listen, err)
5759
}
58-
log.Printf("Listening on %s\n", ln.Addr())
60+
log.Printf("Listening on %s", ln.Addr())
5961

6062
errc := make(chan error)
6163
if ln != nil {

0 commit comments

Comments
 (0)