Skip to content

Commit 8ced626

Browse files
authored
Usage of only proper handler API, no longer need for redundant Context (#2249)
Signed-off-by: Matthias Wessendorf <[email protected]>
1 parent 6b78b7f commit 8ced626

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

docs/function-templates/golang.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,14 @@ They each will listen and respond to incoming HTTP events.
9494

9595
#### Function triggered by HTTP request
9696

97-
When an incoming request is received, your function will be invoked with a standard
98-
Golang [Context](https://golang.org/pkg/context/) as the first parameter followed by
99-
two parameters: Golang's [http.ResponseWriter](https://golang.org/pkg/net/http/#ResponseWriter)
100-
and [http.Request](https://golang.org/pkg/net/http/#Request).
97+
When an incoming request is received, your function will be invoked with two parameters:
98+
Golang's [http.ResponseWriter](https://golang.org/pkg/net/http/#ResponseWriter) and [http.Request](https://golang.org/pkg/net/http/#Request).
10199

102100
Then you can use standard Golang techniques to access the request (eg. read the body)
103101
and set a proper HTTP response of your function, as you can see on the following example:
104102

105103
```go
106-
func Handle(ctx context.Context, res http.ResponseWriter, req *http.Request) {
104+
func Handle(res http.ResponseWriter, req *http.Request) {
107105

108106
// Read body
109107
body, err := ioutil.ReadAll(req.Body)

0 commit comments

Comments
 (0)