I created map[string]interface{} and i want to pass multiple types through the map between 2 reset services.
every time i marshal i get empty map in the field that should contain reflect.Type.
ServiceType:map[]
is it even possible?
code for testing: (the KeyValuePair will represent a single value of the map) and the MessageService can be replaced with any type of course
data := GenericHandlers.KeyValuePair{Key:"ServiceType",Value:reflect.TypeOf(MessageService.MessageService{})}
Json , _ := json.Marshal(data)
resKvp := GenericHandlers.KeyValuePair{}
err := json.Unmarshal(Json,&resKvp)
if(err != nil){
log.Println(err.Error())
}
fmt.Println(resKvp)
type KeyValuePair struct{
Key string
Value interface{}
}