I 'm new to go and I got my mind stuck with something pretty trivial, so I ask for your help, maybe anyone knows why this behaviour happens:
I want to output the query params string of an url object in a template, but apparently because of the "?" char placed in front of the variable, the (whole) output is url encoded. Does question mark has a special meaning in go templates?
instead of param1=value1&value2=param2, output is param1%3dvalue1%26value2%3dparam2
Example in go playground
The Go documentation of the html/template
package explains the behaviour (https://golang.org/pkg/html/template/):
The security model used by this package assumes that template authors are trusted, while Execute's data parameter is not. More details are provided below.
The thing about this is that you should really think twice about why you don't want Go to apply this security behaviour to your template.
Then, if you're really sure you don't want to escape the string use template.URL
intead of a string: https://play.golang.org/p/kfv2tH6WDG