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

String functions: hasPrefix, hasSuffix, etc #1316

Closed
aclowkey opened this issue Nov 17, 2019 · 1 comment
Closed

String functions: hasPrefix, hasSuffix, etc #1316

aclowkey opened this issue Nov 17, 2019 · 1 comment

Comments

@aclowkey
Copy link

aclowkey commented Nov 17, 2019

How about adding some string functions such as hasPrefix, hasSuffix, regexp.Match?
EDIT: Oh I see there's regexp.Match() which should cover all other cases.
But maybe it's still worth to add these simple ones as most programming languages have them without regexes..?

@blake
Copy link
Member

blake commented May 10, 2024

Support for sprig functions was added in #1312 and made available in consul-template version 0.28.0.

The Sprig library has hasPrefix and hasSuffix functions that can be used within Consul template by prefixing the function name with sprig_. E.g., sprig_hasPrefix and sprig_hasSuffix.

@blake blake closed this as completed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants