This should be ok, the map in question has type map[string]MachineSpec. The zero-value there if a key doesn't exist is not nil, it's a struct with zero-valued fields.