We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
fs.FS
Provide an interface for the user to pass in an fs.FS alongside a filename.
This will add some flexibility about how the file is loaded, and makes it easier for users to write tests to verify configs via testing/fstest.
testing/fstest
Something like:
type ConfigDatabase struct { Port string `yaml:"port" env:"PORT" env-default:"5432"` Host string `yaml:"host" env:"HOST" env-default:"localhost"` Name string `yaml:"name" env:"NAME" env-default:"postgres"` User string `yaml:"user" env:"USER" env-default:"user"` Password string `yaml:"password" env:"PASSWORD"` } var cfg ConfigDatabase fsys := os.DirFS("/example/config/folder") err := cleanenv.ReadConfigFS(fsys, "config.yml", &cfg) if err != nil { ... }
The text was updated successfully, but these errors were encountered:
ReadConfigFS
No branches or pull requests
Provide an interface for the user to pass in an
fs.FS
alongside a filename.This will add some flexibility about how the file is loaded, and makes it easier for users to write tests to verify configs via
testing/fstest
.Something like:
The text was updated successfully, but these errors were encountered: