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

make env package functions return copies of their pointed default values #141

Merged
merged 1 commit into from
Jun 14, 2019

Conversation

codesmith14
Copy link
Contributor

I think there is benefit to keeping the default argument as a pointer. Specifically in the gateway, where we are passing in a pointer to a loaded config value which may or may not be nil.

I do think that these functions shouldn't blindly return the default argument as is. Instead they should return a pointer to a copy of the default argument's value. Hopefully this will help reduce confusion since the functions are returning pointers to values, instead of setting the value at a specified pointer.

env/env.go Outdated Show resolved Hide resolved
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.

None yet

3 participants