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
Allow formatted strings to all the sources functions that receive a string #159
Comments
Yes, this is a useful thing to do, but I'm not sure that |
I'm sure that from the security point of view is NO unless you can guarantee that the value to interpolate comes from a trusted source. If I'm doing the Considering that I'm trying to use Do you think that |
I wondered if all the source functions that receive a string as a parameter could receive a string format and a variadic string parameters as the fmt standard Go package does.
My use case was the following
To do that with script you have to execute each subcommand part and do the string interpolation manually.
NOTE this example doesn't illustrate how to handle errors properly to keep it concise.
If
Echo
would accept the parameters asfmt.Sprintf
then the last line would be:It doesn't reduce that much the code, but I thought that it shouldn't hurt and in the end, the variadic strings are optional.
My use case was for only the
Echo
function, but I thought that the other source functions could benefit from the same too.The text was updated successfully, but these errors were encountered: