When using nested structs with fields that have the same name, the error message doesn't specify which struct's field is missing, making it difficult to identify the source of the configuration error
type Config struct {
A struct {
Host string `env:"A_HOST" env-required:"true"`
}
B struct {
Host string `env:"B_HOST" env-required:"true"`
}
}
if err := cleanenv.ReadEnv(&cfg); err != nil {
// field "Host" is required but the value is not provided
}