openfaas/golang-http-template

go-http template query string not available in function

ewilde opened this issue · 3 comments

Summary

In the go-http template headers, body and query string are copied over to the request used to call the function, however the query string is not.

https://github.com/openfaas-incubator/golang-http-template/blob/7bce4849a2657e94d00b0411f2da3ae8a902f3ff/template/golang-http-armhf/main.go#L33-L39

Proposal

  1. Copy query string

or

  1. Document in the template why this is not desired

Why?

As a function developer, I found it confusing that the query string was blank, in order to implement my business code I had to use the alternative template golang-middleware. Also took some time debugging the template code and function code in order to discover this.

My preference would be to copy query string. Happy to pick this up once design is approved

Please go ahead and submit the fix for this.

I think you'll see a similar feature added in the node10-express template to see what the idiomatic style we used was.

Derek add label: design/approved

Derek assign: me