1 Star 0 Fork 527

大德/Golang Build Case

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
hello.go 469 Bytes
一键复制 编辑 原始数据 按行查看 历史
大德 提交于 2021-03-01 18:02 +08:00 . update hello.go.
package main
import (
"fmt"
"net/http"
)
func hello(w http.ResponseWriter, req *http.Request) {
fmt.Fprintf(w, "hello\n")
}
func headers(w http.ResponseWriter, req *http.Request) {
for name, headers := range req.Header {
for _, h := range headers {
fmt.Fprintf(w, "%v: %v\n", name, h)
}
}
}
func main() {
http.HandleFunc("/hello", hello)
http.HandleFunc("/headers", headers)
http.HandleFunc("/time", headers)
http.ListenAndServe(":80", nil)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wdeyu/golang-build-case.git
git@gitee.com:wdeyu/golang-build-case.git
wdeyu
golang-build-case
Golang Build Case
master

搜索帮助