-
Notifications
You must be signed in to change notification settings - Fork 114
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
Environment copied before being mutated #520
Comments
afaict, Do you have an explicit scenario which demonstrates such an issue ? |
That's correct, but only if it's not |
I don't get it. we capture |
This avoids capturing the nil Environment Signed-off-by: Lionello Lunesu <[email protected]>
This avoids capturing the nil Environment Signed-off-by: Lionello Lunesu <[email protected]>
This line initializes the
Environment
, when not initialized by the caller:compose-go/loader/loader.go
Line 269 in 8585af8
But the environment gets copied (implicitly) earlier on this line:
compose-go/loader/loader.go
Line 249 in 8585af8
So, when
Environment
isnil
, the set ofCOMPOSE_PROJECT_NAME
in the map is not visible by the call toLookupValue
.A potential fix is to change
func (cd ConfigDetails) LookupEnv(…)
to a pointer receiver to avoid the copy.The text was updated successfully, but these errors were encountered: