-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
Pointer structs not created with env prefixes #234
Comments
yes, pointers need to be non-nil, otherwise env ignores them... I can't quite remember exactly why, will take a look when I have some time. |
https://github.com/caarlos0/env/compare/nilptr?expand=1 this would init the pointers, but break a lot of other things... would need to investigate more... some other day in the meantime, if anyone knows a lot about the reflect pkg and wants to take a look |
Hi @caarlos0 , I tried to fix the nil pointer issue, Changes:
Thanks |
thanks @NithinGudla! |
this makes sure caarlos0#234 is now implemented. closes caarlos0#234
Following the issue raised in #202, if a pointer struct is used then the default object is not created - this is different to a non-pointer object. See the following example:
This results in:
Notice how
Foo
isnull
, butBar
has the object created.The text was updated successfully, but these errors were encountered: