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

fix: In Parsing expandVariables return unchanged value if not exists in envMap or os-environ #135

Closed
wants to merge 1 commit into from

Conversation

vaibhavmunjal
Copy link

With regex expression (\\)?(\$)(\()?\{?([A-Z0-9_]+)?\}? https://regex101.com/r/IM10C6/1 any value after $ is treating as variable,
Variable is checked in envMap and return empty string if not found, causing some values to cut down e.g. #127 (comment)

@vaibhavmunjal vaibhavmunjal changed the title fix: return unchanged value if not exists in envMap or os-environ fix: In Parsing expandVariables return unchanged value if not exists in envMap or os-environ Feb 28, 2021
return m[submatch[4]]
if _, exists := m[submatch[4]]; exists {
return m[submatch[4]]
} else if len(os.Getenv(submatch[4])) > 0 {

Choose a reason for hiding this comment

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

Maybe use os.LookupEnv instead?

@luisdavim
Copy link

This is pretty much a duplicate of #72

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

Successfully merging this pull request may close these issues.

2 participants