diff --git a/template/golang-http-armhf/go.mod b/template/golang-http-armhf/go.mod index f682c81..930f39e 100644 --- a/template/golang-http-armhf/go.mod +++ b/template/golang-http-armhf/go.mod @@ -4,4 +4,4 @@ go 1.13 replace handler/function => ./function -require github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921 +require github.com/openfaas-incubator/go-function-sdk v0.0.0-20200405082418-b31e65bf8a33 diff --git a/template/golang-http-armhf/go.sum b/template/golang-http-armhf/go.sum index 94e3413..9f41c78 100644 --- a/template/golang-http-armhf/go.sum +++ b/template/golang-http-armhf/go.sum @@ -1,2 +1,2 @@ -github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921 h1:IGP0tlTdv6r/zy3Kw61EhiXao61krCUs5KRHWSzCdxM= -github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921/go.mod h1:F37Kp+hwdHP+o3UKjkGzikQg4weKiMvcegT9vCQjvjE= +github.com/openfaas-incubator/go-function-sdk v0.0.0-20200405082418-b31e65bf8a33 h1:KhbcrtXR+IO7IWF08RzKpgMudBhEeRRqNmRurE1iph4= +github.com/openfaas-incubator/go-function-sdk v0.0.0-20200405082418-b31e65bf8a33/go.mod h1:F37Kp+hwdHP+o3UKjkGzikQg4weKiMvcegT9vCQjvjE= diff --git a/template/golang-http-armhf/main.go b/template/golang-http-armhf/main.go index 2363a39..7661c40 100644 --- a/template/golang-http-armhf/main.go +++ b/template/golang-http-armhf/main.go @@ -97,6 +97,7 @@ func makeRequestHandler() func(http.ResponseWriter, *http.Request) { Method: r.Method, QueryString: r.URL.RawQuery, } + req.WithContext(r.Context()) result, resultErr := function.Handle(req) diff --git a/template/golang-http/function/handler.go b/template/golang-http/function/handler.go index 9e212e7..d201cfd 100644 --- a/template/golang-http/function/handler.go +++ b/template/golang-http/function/handler.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "github.com/openfaas-incubator/go-function-sdk" + handler "github.com/openfaas-incubator/go-function-sdk" ) // Handle a function invocation diff --git a/template/golang-http/go.mod b/template/golang-http/go.mod index f682c81..930f39e 100644 --- a/template/golang-http/go.mod +++ b/template/golang-http/go.mod @@ -4,4 +4,4 @@ go 1.13 replace handler/function => ./function -require github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921 +require github.com/openfaas-incubator/go-function-sdk v0.0.0-20200405082418-b31e65bf8a33 diff --git a/template/golang-http/go.sum b/template/golang-http/go.sum index 94e3413..9f41c78 100644 --- a/template/golang-http/go.sum +++ b/template/golang-http/go.sum @@ -1,2 +1,2 @@ -github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921 h1:IGP0tlTdv6r/zy3Kw61EhiXao61krCUs5KRHWSzCdxM= -github.com/openfaas-incubator/go-function-sdk v0.0.0-20181217173454-cac4b8744921/go.mod h1:F37Kp+hwdHP+o3UKjkGzikQg4weKiMvcegT9vCQjvjE= +github.com/openfaas-incubator/go-function-sdk v0.0.0-20200405082418-b31e65bf8a33 h1:KhbcrtXR+IO7IWF08RzKpgMudBhEeRRqNmRurE1iph4= +github.com/openfaas-incubator/go-function-sdk v0.0.0-20200405082418-b31e65bf8a33/go.mod h1:F37Kp+hwdHP+o3UKjkGzikQg4weKiMvcegT9vCQjvjE= diff --git a/template/golang-http/main.go b/template/golang-http/main.go index 2363a39..7661c40 100644 --- a/template/golang-http/main.go +++ b/template/golang-http/main.go @@ -97,6 +97,7 @@ func makeRequestHandler() func(http.ResponseWriter, *http.Request) { Method: r.Method, QueryString: r.URL.RawQuery, } + req.WithContext(r.Context()) result, resultErr := function.Handle(req)