Download this file
| 1 | package fixture |
| 2 | |
| 3 | // Not compiled: testdata is ignored by the go tool. |
| 4 | |
| 5 | import ( |
| 6 | "fmt" |
| 7 | "strings" |
| 8 | ) |
| 9 | |
| 10 | // The elements of MV-N2 and MV-N3, built here, and the joins that make |
| 11 | // their lists, passed to the head's function (one directly, one through a |
| 12 | // local variable). |
| 13 | func refuseAmbiguous(seg string, sqids, names []string) string { |
| 14 | out := make([]string, len(sqids)) |
| 15 | for i := range sqids { |
| 16 | out[i] = fmt.Sprintf("%s (%q)", sqids[i], names[i]) |
| 17 | } |
| 18 | return ambiguous(seg, strings.Join(out, ", ")) |
| 19 | } |
| 20 | |
| 21 | func refuseSeveral(region string, sqids, names []string) string { |
| 22 | out := make([]string, len(sqids)) |
| 23 | for i := range sqids { |
| 24 | out[i] = fmt.Sprintf("%s (%q)", sqids[i], names[i]) |
| 25 | } |
| 26 | joined := strings.Join(out, ", ") |
| 27 | return several(region, joined) |
| 28 | } |
| 29 | |