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 the trimspace() interpolation function #4910

Merged
merged 4 commits into from
Jan 30, 2016

Conversation

ColinHebert
Copy link
Contributor

This function helps when interpolating string from UNIX files.

For example

resource "docker_container" "test" {
  name         = "test"
  image        = "${docker_image.ubuntu.latest}"
  env          = [
    "PASSWORD=${trimspace(file("files/secrets/password"))}",
  ]
}

@radeksimko
Copy link
Member

It may not be obvious from the name that we're only trimming spaces.
Without reading the docs, one may expect trim(string, cutset) being mapped to strings.Trim().

Would you mind changing the name to trimspace()?

Otherwise this PR is looking good.

@radeksimko radeksimko added the waiting-response An issue/pull request is waiting for a response from the community label Jan 30, 2016
@ColinHebert
Copy link
Contributor Author

Updated

@radeksimko radeksimko removed the waiting-response An issue/pull request is waiting for a response from the community label Jan 30, 2016
@radeksimko radeksimko changed the title Add the trim() interpolation function Add the trimspace() interpolation function Jan 30, 2016
radeksimko added a commit that referenced this pull request Jan 30, 2016
Add the trimspace() interpolation function
@radeksimko radeksimko merged commit f9e369c into hashicorp:master Jan 30, 2016
@ColinHebert ColinHebert deleted the trim branch January 30, 2016 20:39
@ghost
Copy link

ghost commented Apr 28, 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 28, 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.

2 participants