fix bugs pointed out by go vet
This commit is contained in:
parent
f41bb0a2be
commit
72ccd60490
1
grace.go
1
grace.go
@ -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.
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user