Skip to content

Commit

Permalink
Update readme examples, fix nil error
Browse files Browse the repository at this point in the history
  • Loading branch information
NHAS committed Nov 10, 2024
1 parent 439211c commit 1aafa08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ type Config struct {
}

func main() {
populatedConfig, _, err := confy.Config[Config](confy.FromEnvs(confy.DefaultENVDelimiter))
populatedConfig, _, err := confy.Config[Config](confy.FromEnvs(confy.ENVDelimiter))
if err != nil {
fmt.Println("Error loading config:", err)
return
Expand Down Expand Up @@ -169,7 +169,7 @@ type Config struct {
}

func main() {
populatedConfig, _, err := confy.Config[Config](confy.FromCli(confy.DefaultCliDelimiter))
populatedConfig, _, err := confy.Config[Config](confy.FromCli(confy.CLIDelimiter))
if err != nil {
fmt.Println("Error loading config:", err)
return
Expand Down
2 changes: 1 addition & 1 deletion entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func Config[T any](suppliedOptions ...OptionFunc) (result T, warnings []error, e
}

if !anythingWasSet {
return result, warnings, fmt.Errorf("nothing was set in configuration from sources: %s, warnings: %s", o.order, errors.Join(warnings...))
return result, warnings, fmt.Errorf("nothing was set in configuration from sources: %s, warnings: %v", o.order, errors.Join(warnings...))
}

return
Expand Down

0 comments on commit 1aafa08

Please sign in to comment.