dont require comparable config types

This commit is contained in:
Finn 2024-10-23 18:14:05 -07:00
parent 03bf4a6300
commit d993d36416

View file

@ -25,11 +25,11 @@ func RegisterParser(ext string, parser FileParser) {
} }
// Load configuration from files or environment variables // 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...) 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 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 AllowNoSources bool