随笔- 310  文章- 1  评论- 0  阅读- 85655 

随笔分类 -  golang

Go 是一个开源的编程语言,它能让构造简单、可靠且高效的软件变得容易
golang 构建Web服务器
摘要:main.go package main import ( "fmt" "log" "net/http" ) func loggingMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.Re 阅读全文
posted @ 2024-07-23 14:17 boye169 阅读(3) 评论(0) 推荐(0) 编辑
go template 使用
摘要:test.html <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Go Web</title> </head> <body> {{ . 阅读全文
posted @ 2023-01-13 11:30 boye169 阅读(22) 评论(0) 推荐(0) 编辑
go 实现一个简单的web服务
摘要:package main import ( "fmt" "log" "net/http" "strings" ) func sayhelloName(w http.ResponseWriter, r *http.Request) { r.ParseForm() //解析参数,默认是不会解析的 fmt 阅读全文
posted @ 2023-01-11 10:36 boye169 阅读(46) 评论(0) 推荐(0) 编辑
Go 语言环境安装
摘要:下载 https://golang.google.cn/dl/。 linux下安装 1、下载二进制包:go1.4.linux-amd64.tar.gz。 2、将下载的二进制包解压至 /usr/local目录。 tar -C /usr/local -xzf go1.4.linux-amd64.tar. 阅读全文
posted @ 2022-11-22 17:50 boye169 阅读(20) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示