Skip to content

Commit 943627b

Browse files
authored
[chore] Clarify that Unmarshaler only supports structs (#13045)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Clarifies usage of `confmap.Unmarshaler`. This is a limitation that currently exists since mapstructure will fail to map between the types.
1 parent 97a6acc commit 943627b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

confmap/confmap.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ func marshalerHookFunc(orig any) mapstructure.DecodeHookFuncValue {
543543
}
544544

545545
// Unmarshaler interface may be implemented by types to customize their behavior when being unmarshaled from a Conf.
546+
// Only types with struct or pointer to struct kind are supported.
546547
type Unmarshaler interface {
547548
// Unmarshal a Conf into the struct in a custom way.
548549
// The Conf for this specific component may be nil or empty if no config available.

0 commit comments

Comments
 (0)