package main import ( "fmt" "reflect" "encoding/json" ) func StructToMap(data interface{}) map[string]interface{} { result := make(map[string]interface{}) elem := reflect.ValueOf(data).Elem() size := elem.NumField() for i := 0; i < size; i++ { field := elem.Type().Field(i).Name value := elem.Field(i).Interface() result[field] = value } return result } func StructToJsonTagMap(data interface{}) map[