kelseyhightower / envconfig

Golang library for managing configuration data from environment variables
MIT License
5.01k stars 377 forks source link

Support for conditional requirement of variables #203

Open MB175 opened 2 years ago

MB175 commented 2 years ago
type Specification struct {
    FEATURETOGGLE   bool `required:"true"`
    FEATURESETTING  string `conditionalRequired:"{FEATURETOGGLE == true}"`

}

Feature description:


Feel free to close this right away if this feature is somehow present already, in case I overlooked it.