(s string, end int64)
| 91 | } |
| 92 | |
| 93 | func parseSlice(s string, end int64) (int, int, error) { |
| 94 | vals := strings.Split(s, ":") |
| 95 | if len(vals) != 2 { |
| 96 | return 0, 0, errors.New("slice syntax in first argument is from:to") |
| 97 | } |
| 98 | from, err := strconv.Atoi(vals[0]) |
| 99 | if err != nil { |
| 100 | return 0, 0, fmt.Errorf("slice value is not a number: %q", vals[0]) |
| 101 | } |
| 102 | to, err := strconv.Atoi(vals[1]) |
| 103 | if err != nil { |
| 104 | return 0, 0, fmt.Errorf("slice value is not a number: %q", vals[1]) |
| 105 | } |
| 106 | return from, to, nil |
| 107 | } |