ilyakaznacheev / cleanenv

✨Clean and minimalistic environment configuration reader for Golang
MIT License
1.66k stars 115 forks source link

env-required pretty limited usage #142

Closed AndreiCrimezniuc closed 5 months ago

AndreiCrimezniuc commented 5 months ago

env-required has pretty limited usage. As I can see you can set this parameters just for fist layer in config. If you put it in nested config like type Config struct{ Baka BakaType yaml:"baka" }

type BakaType struct{ ID string yaml:"id" BakaLevel yaml:"baka_level" env-required:"true" }

So this config gonna be valid even if BalaLevel is empty. Because this tag only work for Config, and it doesn't care about BakaType (also docs is unclear, you need to find issue to know that syntax is env-required:"true")