Skip to content

Commit

Permalink
initialize data to interface for decode hook (tested)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Sep 14, 2021
1 parent 6577afa commit 381a76b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions decode_hooks.go
Expand Up @@ -62,11 +62,7 @@ func DecodeHookExec(
func ComposeDecodeHookFunc(fs ...DecodeHookFunc) DecodeHookFunc {
return func(f reflect.Value, t reflect.Value) (interface{}, error) {
var err error
var data interface{}

if len(fs) == 0 {
data = f.Interface()
}
data := f.Interface()

newFrom := f
for _, f1 := range fs {
Expand Down

0 comments on commit 381a76b

Please sign in to comment.