internal/https: remove redundant Close in ListenAndServe
This was missed in CL 159701.
Change-Id: Ieffdc2575086b67965d5bef4d0253d644ba34936
Reviewed-on: https://go-review.googlesource.com/c/build/+/205677
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/internal/https/https.go b/internal/https/https.go
index d9305da..45cef37 100644
--- a/internal/https/https.go
+++ b/internal/https/https.go
@@ -51,13 +51,11 @@
if opt.AutocertCacheBucket == "" {
err := http.Serve(ln, handler)
- ln.Close()
return fmt.Errorf("http.Serve = %v", err)
}
// handler is served primarily via HTTPS, so just redirect HTTP to HTTPS.
redirect := &http.Server{
- Addr: ln.Addr().String(),
Handler: http.HandlerFunc(redirectToHTTPS),
}
errc := make(chan error)
@@ -105,10 +103,7 @@
defer ln.Close()
ctx, cancel := context.WithCancel(ctx)
- server := &http.Server{
- Addr: ln.Addr().String(),
- Handler: h,
- }
+ server := &http.Server{Handler: h}
done := make(chan struct{})
go func() {
<-ctx.Done()