Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Commit

Permalink
go-tour: handle error from ListenAndServe
Browse files Browse the repository at this point in the history
LGTM=adg
R=adg, dan.kortschak
CC=golang-codereviews
https://codereview.appspot.com/120440043
  • Loading branch information
campoy committed Aug 4, 2014
1 parent 393eaa4 commit cede31c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion content/methods/web-servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package main

import (
"fmt"
"log"
"net/http"
)

Expand All @@ -17,5 +18,8 @@ func (h Hello) ServeHTTP(

func main() {
var h Hello
http.ListenAndServe("localhost:4000", h)
err := http.ListenAndServe("localhost:4000", h)
if err != nil {
log.Fatal(err)
}
}

0 comments on commit cede31c

Please sign in to comment.