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

Add a substring interpolation function #12870

Merged
merged 1 commit into from
Mar 22, 2017
Merged

Add a substring interpolation function #12870

merged 1 commit into from
Mar 22, 2017

Conversation

joshuaspence
Copy link
Contributor

@joshuaspence joshuaspence commented Mar 19, 2017

Fixes #1431. Adds a new substr interpolation function which can be used to truncate a string.

Adds a new `substr` interpolation function which can be used to truncate a string.
@joshuaspence
Copy link
Contributor Author

> make test TEST='./config' TESTARGS='-run=TestInterpolateFuncSubstr'
==> Checking that code complies with gofmt requirements...
==> Checking AWS provider for unchecked errors...
==> NOTE: at this time we only look for uncheck errors in the AWS package
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/22 08:50:59 Generated command/internal_plugin_list.go
go test -i ./config || exit 1
echo ./config | \
	xargs -t -n4 go test -run=TestInterpolateFuncSubstr -timeout=30s -parallel=4
go test -run=TestInterpolateFuncSubstr -timeout=30s -parallel=4 ./config 
ok  	github.com/hashicorp/terraform/config	0.011s

Copy link
Contributor

@grubernaut grubernaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@grubernaut grubernaut merged commit e71d6d9 into hashicorp:master Mar 22, 2017
mbfrahry pushed a commit that referenced this pull request Mar 28, 2017
Adds a new `substr` interpolation function which can be used to truncate a string.
@joshuaspence joshuaspence deleted the substr branch April 2, 2017 03:15
@dforsber-p
Copy link

substr: 'offset + length' cannot be larger than the length of the string

@grubernaut
Copy link
Contributor

Hey @dforsber-p, I'm assuming this is an issue you encountered with the substring() interpolation function. Would you mind opening a detailed issue on Terraform with the problem you're seeing?
Thanks!

@ghost
Copy link

ghost commented Apr 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add substring between built-in interpolation functions
4 participants