|
@@ -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
|