-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add url encode and decode functions #248
Comments
Just here to +1 this, for anyone looking for a solution, remember you can always add your custom functions to the function map: func urlDecode(str string) string { s, _ := url.QueryUnescape(str); return s }
func urlEncode(str string) string { return url.QueryEscape(str) }
fmap := sprig.TxtFuncMap()
fmap["urlEncode"] = urlEncode
fmap["urlDecode"] = urlDecode
// then use like:
template.New("").Funcs(fmap).Parse(yourTemplate) |
In Apache Airflow, we need to build the URL from the values from the |
I found a workaround. Go templaes supports |
Helm is using sprig as a source of extended functions.
In helm url encode and decode functions would be useful i think.
So it would be great to add them to sprig.
P.S. For example it would be extremely useful in gitlab chart MR - https://gitlab.com/gitlab-org/charts/gitlab/-/merge_requests/1234
The text was updated successfully, but these errors were encountered: