init commit
This commit is contained in:
20
archive/go/test/http.go
Normal file
20
archive/go/test/http.go
Normal file
@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
// 测试http是否会处理完请求后才结束
|
||||
// 结果,不会
|
||||
|
||||
func main() {
|
||||
|
||||
http.HandleFunc("/test", func(writer http.ResponseWriter, request *http.Request) {
|
||||
time.Sleep(time.Second * 5)
|
||||
writer.Write([]byte("success"))
|
||||
})
|
||||
|
||||
http.ListenAndServe(":8080", nil)
|
||||
|
||||
}
|
Reference in New Issue
Block a user