mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-11 19:41:43 +08:00
Update 15.2.md (#794)
This commit is contained in:
@@ -64,7 +64,7 @@ http.ListenAndServe(":8080", http.HandlerFunc(HelloServer))
|
||||
2)`fmt.Fprint` 和 `fmt.Fprintf` 都是可以用来写入 `http.ResponseWriter` 的函数(他们实现了 `io.Writer`)。
|
||||
比如我们可以使用
|
||||
```go
|
||||
fmt.Fprintf(w, "<h1>%s<h1><div>%s</div>", title, body)
|
||||
fmt.Fprintf(w, "<h1>%s</h1><div>%s</div>", title, body)
|
||||
```
|
||||
来构建一个非常简单的网页并插入 `title` 和 `body` 的值。
|
||||
|
||||
|
Reference in New Issue
Block a user