(options []string, answer string)
| 148 | } |
| 149 | |
| 150 | func IndexFor(options []string, answer string) (int, error) { |
| 151 | for ix, a := range options { |
| 152 | if a == answer { |
| 153 | return ix, nil |
| 154 | } |
| 155 | } |
| 156 | return -1, NoSuchAnswerErr(answer, options) |
| 157 | } |
| 158 | |
| 159 | func IndexesFor(options []string, answers ...string) ([]int, error) { |
| 160 | indexes := make([]int, len(answers)) |