code: func typedDecodeHook(h DecodeHookFunc) DecodeHookFunc {
  	// Create variables here so we can reference them with the reflect pkg
  	var f1 DecodeHookFuncType
  	var f2 DecodeHookFuncKind
  
  	// Fill in the variables into this interface and the rest is done
  	// automatically using the reflect package.
  	potential := []interface{}{f1, f2}
  
  	v := reflect.ValueOf(h)
  	vt := v.Type()
  	for _, raw := range potential {
  		pt := reflect.ValueOf(raw).Type()
  		if vt.ConvertibleTo(pt) {
  			return v.Convert(pt).Interface()
  		}
  	}
  
  	return nil
  }
docs: // typedDecodeHook takes a raw DecodeHookFunc (an interface{}) and turns
  // it into the proper DecodeHookFunc type, such as DecodeHookFuncType.