Skip to content

Commit ee039e7

Browse files
joeybloggsjoeybloggs
authored andcommitted
update example
1 parent 5c33cff commit ee039e7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ func main() {
5858
// HelloWorld ...
5959
func HelloWorld(c lars.Context) {
6060
c.Response().Write([]byte("Hello World"))
61+
62+
// this will also work, Response() complies with http.ResponseWriter interface
63+
fmt.Fprint(c.Response(), "Hello World")
6164
}
6265
```
6366

examples/hello-world/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ func main() {
2020
// HelloWorld ...
2121
func HelloWorld(c lars.Context) {
2222
c.Response().Write([]byte("Hello World"))
23+
24+
// this will also work, Response() complies with http.ResponseWriter interface
25+
// fmt.Fprint(c.Response(), "Hello World")
2326
}

0 commit comments

Comments
 (0)