mirror of
https://github.com/golang/go
synced 2024-11-24 19:00:13 -07:00
e236b6721c
Fixes test regression introduced by golang.org/cl/53071. Change-Id: Ibb085cf6d6be7b91b7c90b7bc6237c10f3097703 Reviewed-on: https://go-review.googlesource.com/60775 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
28 lines
623 B
Diff
28 lines
623 B
Diff
--- final.go 2017-08-31 13:19:00.422925489 -0700
|
|
+++ final-test.go 2017-08-31 13:23:43.381391659 -0700
|
|
@@ -8,6 +8,7 @@
|
|
"html/template"
|
|
"io/ioutil"
|
|
"log"
|
|
+ "net"
|
|
"net/http"
|
|
"regexp"
|
|
)
|
|
@@ -86,5 +87,15 @@
|
|
http.HandleFunc("/edit/", makeHandler(editHandler))
|
|
http.HandleFunc("/save/", makeHandler(saveHandler))
|
|
|
|
- log.Fatal(http.ListenAndServe(":8080", nil))
|
|
+ l, err := net.Listen("tcp", "127.0.0.1:0")
|
|
+ if err != nil {
|
|
+ log.Fatal(err)
|
|
+ }
|
|
+ err = ioutil.WriteFile("final-test-port.txt", []byte(l.Addr().String()), 0644)
|
|
+ if err != nil {
|
|
+ log.Fatal(err)
|
|
+ }
|
|
+ s := &http.Server{}
|
|
+ s.Serve(l)
|
|
+ return
|
|
}
|