func addVolume(volumes []ServiceVolume, volume1 ServiceVolume) []ServiceVolume {
	for _, volume2 := range volumes {
		if volume2.Short.ContainerPath == volume1.Short.ContainerPath {
			return volumes
		}
	}
	return append(volumes, volume1)
}
Same logic for equal volumes as
https://github.com/docker/compose/blob/99e67d0c061fa3d9b9793391f3b7c8bdf8e841fc/compose/config/config.py#L1423
package config
func addPortBinding(ports []PortBinding, port1 PortBinding) []PortBinding {
	for _, port2 := range ports {
		if port1 == port2 {
			return ports
		}
	}
	return append(ports, port1)
}