(sliceName string, tests []handlerTest)
| 859 | } |
| 860 | |
| 861 | func checkNoDups(sliceName string, tests []handlerTest) { |
| 862 | seen := map[string]bool{} |
| 863 | for _, tt := range tests { |
| 864 | if seen[tt.name] { |
| 865 | panic(fmt.Sprintf("duplicate handlerTest named %q in var %s", tt.name, sliceName)) |
| 866 | } |
| 867 | seen[tt.name] = true |
| 868 | } |
| 869 | } |
| 870 | |
| 871 | func init() { |
| 872 | checkNoDups("handlerTests", handlerTests) |