Skip to content

Commit

Permalink
Merge branch version/0-47-0-RC1 to adopt changes from PR #3512
Browse files Browse the repository at this point in the history
  • Loading branch information
as-builds committed Sep 25, 2024
2 parents 7bd12e5 + 0eb7c24 commit a384772
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/config/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (i *Instance) Get(key string) interface{} {
return result
}
if opt := mediator.GetOption(key); mediator.KnownOption(opt) {
return opt.Default
return mediator.GetDefault(opt)
}
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions internal/mediators/config/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ func RegisterOptionWithEvents(key string, t Type, defaultValue interface{}, get,
func KnownOption(rule Option) bool {
return rule.isRegistered
}

func GetDefault(opt Option) interface{} {
if enum, ok := opt.Default.(*Enums); ok {
return enum.Default
}
return opt.Default
}

0 comments on commit a384772

Please sign in to comment.