Skip to content

Commit 5b23388

Browse files
ewildealexellis
authored andcommitted
Adds method to request struct
Signed-off-by: Edward Wilde <[email protected]>
1 parent 398092b commit 5b23388

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

template/golang-http-armhf/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"handler/function"
1111
// "github.com/alexellis/golang-http-template/template/golang-http/function"
12-
"github.com/openfaas-incubator/go-function-sdk"
12+
handler "github.com/openfaas-incubator/go-function-sdk"
1313
)
1414

1515
func makeRequestHandler() func(http.ResponseWriter, *http.Request) {
@@ -31,6 +31,7 @@ func makeRequestHandler() func(http.ResponseWriter, *http.Request) {
3131
req := handler.Request{
3232
Body: input,
3333
Header: r.Header,
34+
Method: r.Method,
3435
}
3536

3637
result, resultErr := function.Handle(req)

template/golang-http/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"handler/function"
1111
// "github.com/alexellis/golang-http-template/template/golang-http/function"
12-
"github.com/openfaas-incubator/go-function-sdk"
12+
handler "github.com/openfaas-incubator/go-function-sdk"
1313
)
1414

1515
func makeRequestHandler() func(http.ResponseWriter, *http.Request) {
@@ -31,6 +31,7 @@ func makeRequestHandler() func(http.ResponseWriter, *http.Request) {
3131
req := handler.Request{
3232
Body: input,
3333
Header: r.Header,
34+
Method: r.Method,
3435
}
3536

3637
result, resultErr := function.Handle(req)

0 commit comments

Comments
 (0)