mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-11-13 17:36:12 +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`)。
|
2)`fmt.Fprint` 和 `fmt.Fprintf` 都是可以用来写入 `http.ResponseWriter` 的函数(他们实现了 `io.Writer`)。
|
||||||
比如我们可以使用
|
比如我们可以使用
|
||||||
```go
|
```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` 的值。
|
来构建一个非常简单的网页并插入 `title` 和 `body` 的值。
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user