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

Optional value (ptr) via env #81

Open
DHorrible opened this issue Sep 27, 2021 · 0 comments
Open

Optional value (ptr) via env #81

DHorrible opened this issue Sep 27, 2021 · 0 comments

Comments

@DHorrible
Copy link

Hello, I have used the lib for building config from env and a file. If I created field as pointer then I thought that it is as optional and it is not bound (nil value). When I set value for pointer field in a config file my logic is gone well, but if I set via env variable then my program throw exception ("unsupported type .")

type Config struct {
  optField *MyField `env:"OPT_VALUE"`
}

I think that 'cleanenv' have to implement same logic with env that a config file and this way not provide an unexpected error.

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

No branches or pull requests

1 participant