code: func ValidateWeightDevice(val string) (*blkiodev.WeightDevice, error) {
  	split := strings.SplitN(val, ":", 2)
  	if len(split) != 2 {
  		return nil, fmt.Errorf("bad format: %s", val)
  	}
  	if !strings.HasPrefix(split[0], "/dev/") {
  		return nil, fmt.Errorf("bad format for device path: %s", val)
  	}
  	weight, err := strconv.ParseUint(split[1], 10, 0)
  	if err != nil {
  		return nil, fmt.Errorf("invalid weight for device: %s", val)
  	}
  	if weight > 0 && (weight < 10 || weight > 1000) {
  		return nil, fmt.Errorf("invalid weight for device: %s", val)
  	}
  
  	return &blkiodev.WeightDevice{
  		Path:   split[0],
  		Weight: uint16(weight),
  	}, nil
  }
docs: // ValidateWeightDevice validates that the specified string has a valid device-weight format.