func serializeToMap(v interface{}) map[string]interface{} {
	data, err := json.Marshal(v)
	if err != nil {
		logger.Criticalf("serializeToMap: marshal to json failed: %v", err)
		return nil
	}

	var asMap map[string]interface{}
	err = json.Unmarshal(data, &asMap)
	if err != nil {
		logger.Criticalf("serializeToMap: unmarshal to map failed: %v", err)
		return nil
	}

	return asMap
}
// serializeToMap is a convenience function for marshaling v into a
// map[string]interface{}. It works by marshalling v into json and then
// unmarshaling back to a map.
serializeToMap is a convenience function for marshaling v into a
map[string]interface{}. It works by marshalling v into json and then
unmarshaling back to a map.
// serializeToMap is a convenience function for marshaling v into a // map [ string ] interface {} . It works by marshalling v into json and then // unmarshaling back to a map .
func serializeToMap(v interface{}) map[string]interface{} {
	data, err := json.Marshal(v)
	if err != nil {
		logger.Criticalf("serializeToMap: marshal to json failed: %v", err)
		return nil
	}
	var asMap map[string]interface{}
	err = json.Unmarshal(data, &asMap)
	if err != nil {
		logger.Criticalf("serializeToMap: unmarshal to map failed: %v", err)
		return nil
	}
	return asMap
}
func serializeToMap ( v interface { } ) map [ string ] interface { } { data , err := json . Marshal ( v ) if err != nil { logger . Criticalf ( " " , err ) return nil } var asMap map [ string ] interface { } err = json . Unmarshal ( data , & asMap ) if err != nil { logger . Criticalf ( " " , err ) return nil } return asMap }
serializeToMap is a convenience function for marshaling v into a
map[string]interface{}.
serializeToMap is a convenience function for marshaling v into a map [ string ] interface {} .