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 env var from host truncated at equal sign #271

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Conversation

thomasten
Copy link
Member

  • first commit improves debugging with gdb by disabling some Go optimizations
  • second commit fixes the bug where an env var from host like FOO=bar=baz was truncated to the value bar

Copy link

netlify bot commented Apr 24, 2024

Deploy Preview for ego-docs canceled.

Name Link
🔨 Latest commit d1dbb51
🔍 Latest deploy log https://app.netlify.com/sites/ego-docs/deploys/6629168adea71400082d62c1

Comment on lines 54 to 55
splitString := strings.SplitN(envVar, "=", 2)
hostEnvironMap[splitString[0]] = splitString[1]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
splitString := strings.SplitN(envVar, "=", 2)
hostEnvironMap[splitString[0]] = splitString[1]
envName, envValue, _ := strings.Cut(envVar, "=")
hostEnvironMap[envName] = envValue

The Go docs recommend using Cut if splitting around the first instance of a separator.
There shouldn't be any functional difference though

@thomasten thomasten merged commit f17fe57 into master Apr 24, 2024
9 checks passed
@thomasten thomasten deleted the fix-envvar-equalsign branch April 24, 2024 14:33
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