Skip to content

Commit

Permalink
Fix config issue with type conversion
Browse files Browse the repository at this point in the history
Fixes #895.
  • Loading branch information
LandonTClipp committed Jan 20, 2025
1 parent 0f55ecb commit f8c43c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mockery-tools.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=v2.51.0
VERSION=v2.51.1
10 changes: 8 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,14 @@ func (c *Config) addSubPkgConfig(ctx context.Context, subPkgPath string, parentP
log.Trace().Msgf("parent-package config: %v", parentPkgConfig)

// Merge the parent config with the sub-package config.
parentConfigSection := parentPkgConfig["config"].(map[string]any)
subPkgConfigSection := subPkgConfig["config"].(map[string]any)
parentConfigSection, ok := parentPkgConfig["config"].(map[string]any)
if !ok {
parentConfigSection = map[string]any{}
}
subPkgConfigSection, ok := subPkgConfig["config"].(map[string]any)
if !ok {
subPkgConfigSection = map[string]any{}
}
for key, val := range parentConfigSection {
if _, keyInSubPkg := subPkgConfigSection[key]; !keyInSubPkg {
subPkgConfigSection[key] = val
Expand Down

0 comments on commit f8c43c6

Please sign in to comment.