Skip to content

Conversation

@particleflux
Copy link
Contributor

The previous version did, while returning a separate slice as output, also modify the original input slice. Deleting an element there then led to empty strings in the "unload --all" loop, when the loop slice args was implicitly modified.
This, in the end, lead to errors on unload --all when attempting to delete profiles named "".

e.g.:

$ env-manager unload --all
Unloading all profiles: awsMain,tfMysqlShared80Dev,allProxy,tfMysqlAuthDev

args: []string{"awsMain", "tfMysqlShared80Dev", "allProxy", "tfMysqlAuthDev"}

Unloading profile: awsMain
args: []string{"tfMysqlShared80Dev", "allProxy", "tfMysqlAuthDev", ""}

Unloading profile: allProxy
args: []string{"tfMysqlShared80Dev", "tfMysqlAuthDev", "", ""}

Unloading profile: 
Error: profile name cannot be empty

Solved by copying the input slice.

The previous version did, while returning a separate slice as output,
also modify the original input slice. Deleting an element there then led
to empty strings in the "unload --all" loop, when the loop slice `args`
was implicitly modified.

Solved by copying the input slice.
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.

1 participant