dont require comparable config types
This commit is contained in:
parent
03bf4a6300
commit
d993d36416
1 changed files with 2 additions and 2 deletions
|
@ -25,11 +25,11 @@ func RegisterParser(ext string, parser FileParser) {
|
|||
}
|
||||
|
||||
// Load configuration from files or environment variables
|
||||
func Load[C comparable](filenames ...string) (C, error) {
|
||||
func Load[C any](filenames ...string) (C, error) {
|
||||
return Loader[C]{}.Load(filenames...)
|
||||
}
|
||||
|
||||
type Loader[C comparable] struct {
|
||||
type Loader[C any] struct {
|
||||
// AllowNoSources supresses errors when no configuration data sources can be found. When set to false (default), if none of the listed config files are found and no environment variables match config struct field names, an error will be returned
|
||||
AllowNoSources bool
|
||||
|
||||
|
|
Loading…
Reference in a new issue