code: func ParseVolume(spec string) (types.ServiceVolumeConfig, error) {
  	volume := types.ServiceVolumeConfig{}
  
  	switch len(spec) {
  	case 0:
  		return volume, errors.New("invalid empty volume spec")
  	case 1, 2:
  		volume.Target = spec
  		volume.Type = string(mount.TypeVolume)
  		return volume, nil
  	}
  
  	buffer := []rune{}
  	for _, char := range spec + string(endOfSpec) {
  		switch {
  		case isWindowsDrive(buffer, char):
  			buffer = append(buffer, char)
  		case char == ':' || char == endOfSpec:
  			if err := populateFieldFromBuffer(char, buffer, &volume); err != nil {
  				populateType(&volume)
  				return volume, errors.Wrapf(err, "invalid spec: %s", spec)
  			}
  			buffer = []rune{}
  		default:
  			buffer = append(buffer, char)
  		}
  	}
  
  	populateType(&volume)
  	return volume, nil
  }
docs: // ParseVolume parses a volume spec without any knowledge of the target platform