You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
407 B
23 lines
407 B
package codec |
|
|
|
import ( |
|
"fmt" |
|
"testing" |
|
) |
|
|
|
type Config struct { |
|
Fm float64 |
|
} |
|
|
|
func TestMapstructure(t *testing.T) { |
|
// var arr1 [][]float64 |
|
// arr2T := reflect.SliceOf(reflect.SliceOf(reflect.TypeOf(1.0))) |
|
// fmt.Println(reflect.TypeOf(arr1) == arr2T, arr2T.Kind()) |
|
|
|
cfg := &Config{} |
|
err := MapDecode(map[string]any{"fm": "3.1415"}, cfg) |
|
if err != nil { |
|
panic(err) |
|
} |
|
fmt.Printf("%#v\n", cfg) |
|
}
|
|
|