code: func fromDecodeHookFunc(hook DecodeHookFunc) mapstructure.DecodeHookFuncType {
  	return func(from, to reflect.Type, data interface{}) (interface{}, error) {
  		var value reflect.Value
  		if data != nil {
  			value = reflect.ValueOf(data)
  		} else {
  			// mapstructure is pretty good about giving us non-nil data but
  			// let's process it gracefully anyway.
  			value = reflect.Zero(from)
  		}
  
  		out, err := hook(from, to, value)
  		if err != nil {
  			return nil, err
  		}
  
  		return out.Interface(), nil
  	}
  }
docs: // Note: DecodeHookFunc is a reflect.Value version of DecodeHookFuncType.
  // Builds a mapstructure-compatible hook from a DecodeHookFunc.