创建包含地图的切片[重复]

This question already has an answer here:

I'm trying to create a data structure that includes a slice containing a map. This is what I have:

data := map[string]interface{}{"Offset": "0", "Properties": []string{}, "Category": "all", "Locations": []string{}, "Accounts": "100" } 

I need the "properties" element to include a map that looks like this:

{"key": "Type", "value": "User"}

This seems to be harder than it should be, or maybe I'm just being stupid.

</div>

Something like this should be what you want (playground)

data := map[string]interface{}{"Offset": "0",
    "Properties": map[string]string{
        "key":   "Type",
        "value": "User",
    },
    "Category":  "all",
    "Locations": []string{},
    "Accounts":  "100",
}