func (machines MachineMap) MarshalJSON() ([]byte, error) { machinesStrings := make(map[string]*Machine, len(machines)) for uuid, machine := range machines { machinesStrings[uuid.String()] = machine } return json.Marshal(machinesStrings) }
func (disks HardDiskMap) MarshalJSON() ([]byte, error) { disksStrings := make(map[string]*HardDisk, len(disks)) for uuid, disk := range disks { disksStrings[uuid.String()] = disk } return json.Marshal(disksStrings) }