func failRateToFloat()

in job/main.go [60:75]


func failRateToFloat(s string) (float64, error) {
	// Default empty variable to 0
	if s == "" {
		return 0, nil
	}

	// Convert string to float
	failRate, err := strconv.ParseFloat(s, 64)

	// Check that rate is valid
	if failRate < 0 || failRate > 1 {
		return failRate, fmt.Errorf("Invalid FAIL_RATE value: %f. Must be a float between 0 and 1 inclusive.", failRate)
	}

	return failRate, err
}