I'm using the github.com/samalba/dockerclient and want to create a Container. So, the method is CreateContainer, which needs a ContainerConfig.
The ContainerConfig is a struct. And there's a field Volumes, the type of which is type map[string] struct{}.
I know that I could create such a map with make(map[string]struct{})
But how do I assign values to the map?
cc := dockerclient.ContainerConfig{Volumes: map[string]struct{}{ "key1": struct{}{}, "key2": struct{}{} } }. E.g.: play.golang.org/p/-ldjIDxVzN. You could also useempty := struct{}{}to make it more readable.