func UnitNumber(unitName string) (int, error) {
	s := validUnit.FindStringSubmatch(unitName)
	if s == nil {
		return 0, fmt.Errorf("%q is not a valid unit name", unitName)
	}
	num, err := strconv.Atoi(s[2])
	if err != nil {
		// Shouldn't happen, the regexp checks for digits.
		return 0, errors.Trace(err)
	}
	return num, nil
}
// UnitNumber returns the number of the unit within the
// application. It returns an error if unitName is not a valid unit
// name.
UnitNumber returns the number of the unit within the
application. It returns an error if unitName is not a valid unit
name.
// UnitNumber returns the number of the unit within the // application . It returns an error if unitName is not a valid unit // name .
func UnitNumber(unitName string) (int, error) {
	s := validUnit.FindStringSubmatch(unitName)
	if s == nil {
		return 0, fmt.Errorf("%q is not a valid unit name", unitName)
	}
	num, err := strconv.Atoi(s[2])
	if err != nil {
		return 0, errors.Trace(err)
	}
	return num, nil
}
func UnitNumber ( unitName string ) ( int , error ) { s := validUnit . FindStringSubmatch ( unitName ) if s == nil { return 0 , fmt . Errorf ( " " , unitName ) } num , err := strconv . Atoi ( s [ 2 ] ) if err != nil { return 0 , errors . Trace ( err ) } return num , nil }
UnitNumber returns the number of the unit within the
application.
UnitNumber returns the number of the unit within the application .
// Shouldn't happen, the regexp checks for digits.