Skip to content
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

stringify function #6

Closed
jchauncey opened this issue Feb 2, 2016 · 2 comments
Closed

stringify function #6

jchauncey opened this issue Feb 2, 2016 · 2 comments

Comments

@jchauncey
Copy link

So I need a template function that will wrap double quotes around a provided string. So something like this: {{ stringify "this string" }}. Right now go templates will not enclose the string with quotes so I have to do something like this: `"{{"this string"}}". Which looks weird when Im using go templates to output configuration files.

@technosophos
Copy link
Member

I'm thinking that a function called quote would be good for that. Should I add a squote version for single quotes, too?

So {{quote "Hello"}} would produce "hello" in the destination text.

Does that sound right?

@jchauncey
Copy link
Author

yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants