Skip to content

Commit

Permalink
fix lint issuesAllow Config.Explain on empty Config
Browse files Browse the repository at this point in the history
  • Loading branch information
ktong committed Jul 8, 2024
1 parent b149c9a commit a16c998
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.2.2] - 2024-07-08

### Fixed

- Allow Config.Explain on empty Config (#408).

## [1.2.1] - 2024-06-20

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (c *Config) transformKeys(m map[string]any) {
// from loaders for the given path. It blur sensitive information.
// The path is case-insensitive unless konf.WithCaseSensitive is set.
func (c *Config) Explain(path string) string {
if c == nil {
if c == nil || c.values.Load() == nil {
return path + " has no configuration.\n\n"
}

Expand Down

0 comments on commit a16c998

Please sign in to comment.