add vendor
This commit is contained in:
1 parent
a45b1f3603
commit
4fd4c7018e
494 files changed
+255023
-9
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package utils
|
||||
|
||||
import "reflect"
|
||||
|
||||
// ToMap struct to map[string]interface{}
|
||||
func ToMap(ss interface{}) map[string]interface{} {
|
||||
t := reflect.ValueOf(ss).Elem()
|
||||
|
||||
smap := make(map[string]interface{})
|
||||
|
||||
for i := 0; i < t.NumField(); i++ {
|
||||
f := t.Field(i)
|
||||
smap[t.Type().Field(i).Name] = f.Interface()
|
||||
}
|
||||
|
||||
return smap
|
||||
}
|
||||
Reference in new issue
Block a user