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
False value in json file #82
Comments
You can use pointer for required values with proper zero values. type Config struct {
FeatureEnabled *bool `env-required:"true" yaml:"enabled"`
} |
Thank you, it works. |
Some "no value" is required for detecting non-existent but required fields. Zero value is not so good idea, especially for Anther problem is lack of support pointer fields for environment vars: #81 |
I'm trying to fill a required boolean field in the JSON file, and when the value is
false
, the following error raises:field "boolVarName" is required but the value is not provided
.But when I change the value to
true
, everything goes well.I think the issue is in the condition of line 316 of
cleanenv.go
, or the condition of line 329 where you checkmeta.isFieldValueZero()
.The text was updated successfully, but these errors were encountered: