fix bugs pointed out by go vet

This commit is contained in:
Naitik Shah 2013-09-18 17:58:04 -07:00
parent f41bb0a2be
commit 72ccd60490
2 changed files with 2 additions and 3 deletions

View File

@ -161,7 +161,6 @@ func Wait(listeners []Listener) (err error) {
} }
} }
} }
panic("not reached")
} }
// Try to inherit listeners from the parent process. // Try to inherit listeners from the parent process.

View File

@ -31,7 +31,7 @@ func wait(wg *sync.WaitGroup, url string) {
defer res.Body.Close() defer res.Body.Close()
var r response var r response
if err := json.NewDecoder(res.Body).Decode(&r); err != nil { if err := json.NewDecoder(res.Body).Decode(&r); err != nil {
log.Fatal("Error decoding json: %s", err) log.Fatalf("Error decoding json: %s", err)
} }
if r.Pid == os.Getpid() { if r.Pid == os.Getpid() {
return return
@ -54,7 +54,7 @@ func wait(wg *sync.WaitGroup, url string) {
func httpsServer(addr string) *http.Server { func httpsServer(addr string) *http.Server {
cert, err := tls.X509KeyPair(localhostCert, localhostKey) cert, err := tls.X509KeyPair(localhostCert, localhostKey)
if err != nil { if err != nil {
log.Fatal("error loading cert: %v", err) log.Fatalf("error loading cert: %v", err)
} }
return &http.Server{ return &http.Server{
Addr: addr, Addr: addr,