better error message for concurrency

This commit is contained in:
David Dollar
2014-06-19 18:57:55 -04:00
parent ac64b63ecd
commit 73521422be
+2 -2
View File
@@ -50,13 +50,13 @@ func parseConcurrency(value string) (map[string]int, error) {
parts := strings.Split(value, ",")
for _, part := range parts {
if !strings.Contains(part, "=") {
return concurrency, errors.New("Parsing concurency")
return concurrency, errors.New("Concurrency should be in the format: foo=1,bar=2")
}
nameValue := strings.Split(part, "=")
n, v := strings.TrimSpace(nameValue[0]), strings.TrimSpace(nameValue[1])
if n == "" || v == "" {
return concurrency, errors.New("Parsing concurency")
return concurrency, errors.New("Concurrency should be in the format: foo=1,bar=2")
}
numProcs, err := strconv.ParseInt(v, 10, 16)