summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mitchellh/mapstructure/mapstructure.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-04-24 20:11:36 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-04-24 20:11:36 -0400
commitf5437632f486b7d0a0a181c58f113c86d032b02c (patch)
tree407388e3003a210a89f4b2128d7ad656f8b79d26 /vendor/github.com/mitchellh/mapstructure/mapstructure.go
parent7f68a60f8c228d5604e0566bf84cabb145d16c37 (diff)
downloadchat-f5437632f486b7d0a0a181c58f113c86d032b02c.tar.gz
chat-f5437632f486b7d0a0a181c58f113c86d032b02c.tar.bz2
chat-f5437632f486b7d0a0a181c58f113c86d032b02c.zip
Upgrading server dependancies (#6215)
Diffstat (limited to 'vendor/github.com/mitchellh/mapstructure/mapstructure.go')
-rw-r--r--vendor/github.com/mitchellh/mapstructure/mapstructure.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go
index 6dee0ef0a..6ec5c3335 100644
--- a/vendor/github.com/mitchellh/mapstructure/mapstructure.go
+++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go
@@ -1,5 +1,5 @@
-// The mapstructure package exposes functionality to convert an
-// arbitrary map[string]interface{} into a native Go structure.
+// Package mapstructure exposes functionality to convert an arbitrary
+// map[string]interface{} into a native Go structure.
//
// The Go structure can be arbitrarily complex, containing slices,
// other structs, etc. and the decoder will properly decode nested
@@ -32,7 +32,12 @@ import (
// both.
type DecodeHookFunc interface{}
+// DecodeHookFuncType is a DecodeHookFunc which has complete information about
+// the source and target types.
type DecodeHookFuncType func(reflect.Type, reflect.Type, interface{}) (interface{}, error)
+
+// DecodeHookFuncKind is a DecodeHookFunc which knows only the Kinds of the
+// source and target types.
type DecodeHookFuncKind func(reflect.Kind, reflect.Kind, interface{}) (interface{}, error)
// DecoderConfig is the configuration that is used to create a new decoder
@@ -436,7 +441,7 @@ func (d *Decoder) decodeFloat(name string, data interface{}, val reflect.Value)
case dataKind == reflect.Uint:
val.SetFloat(float64(dataVal.Uint()))
case dataKind == reflect.Float32:
- val.SetFloat(float64(dataVal.Float()))
+ val.SetFloat(dataVal.Float())
case dataKind == reflect.Bool && d.config.WeaklyTypedInput:
if dataVal.Bool() {
val.SetFloat(1)