Browse Source

no comment

Dmitry Yu Okunev 2 years ago
parent
commit
b8a98d89e1
1 changed files with 6 additions and 5 deletions
  1. 6 5
      steps/main.go

+ 6 - 5
steps/main.go

@@ -1,14 +1,14 @@
 package main
 
 import (
+	"fmt"
 	"strconv"
 	"strings"
-	"fmt"
 )
 
 type step struct {
 	Destinations []string
-	Delay int
+	Delay        int
 }
 
 type steps []step
@@ -16,10 +16,11 @@ type steps []step
 func parseSteps(in string) (result steps) {
 	stepsStr := strings.Split(in, ",")
 	for _, stepStr := range stepsStr {
-		stepParts := strings.Split(stepStr, ":")
-		if len(stepParts) < 1 {
-			panic(fmt.Errorf("Invalid syntax: %v", stepStr))
+		if len(stepStr) == 0 {
+			fmt.Printf("An empty step, skipping.")
+			continue
 		}
+		stepParts := strings.Split(stepStr, ":")
 		delay := 0
 		if len(stepParts) >= 2 {
 			var err error