File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -76,21 +76,22 @@ func getGraphType(tipe reflect.Type) Output {
7676}
7777
7878func getGraphList (tipe reflect.Type ) * List {
79- switch tipe {
80- case reflect .TypeOf ([]int {}):
81- case reflect .TypeOf ([]int8 {}):
82- case reflect .TypeOf ([]int32 {}):
83- case reflect .TypeOf ([]int64 {}):
84- return NewList (Int )
85- case reflect .TypeOf ([]bool {}):
86- return NewList (Boolean )
87- case reflect .TypeOf ([]float32 {}):
88- case reflect .TypeOf ([]float64 {}):
89- return NewList (Float )
90- case reflect .TypeOf ([]string {}):
91- return NewList (String )
79+ if tipe .Kind () == reflect .Slice {
80+ switch tipe .Elem ().Kind () {
81+ case reflect .Int :
82+ case reflect .Int8 :
83+ case reflect .Int32 :
84+ case reflect .Int64 :
85+ return NewList (Int )
86+ case reflect .Bool :
87+ return NewList (Boolean )
88+ case reflect .Float32 :
89+ case reflect .Float64 :
90+ return NewList (Float )
91+ case reflect .String :
92+ return NewList (String )
93+ }
9294 }
93-
9495 // finaly bind object
9596 t := reflect .New (tipe .Elem ())
9697 name := strings .Replace (fmt .Sprint (tipe .Elem ()), "." , "_" , - 1 )
You can’t perform that action at this time.
0 commit comments