fix test lint error

This commit is contained in:
thinkerou 2022-02-05 21:39:50 +08:00
parent b40ded1837
commit f19125ed61

View File

@ -90,7 +90,12 @@ func TestH2c(t *testing.T) {
r.GET("/", func(c *Context) {
c.String(200, "<h1>Hello world</h1>")
})
go http.Serve(ln, r.Handler())
go func() {
err := http.Serve(ln, r.Handler())
if err != nil {
fmt.Println(err)
}
}()
defer ln.Close()
url := "http://" + ln.Addr().String() + "/"