(t *testing.T, comments []SwaggerComment)
| 228 | } |
| 229 | |
| 230 | func assertUniqueRoutes(t *testing.T, comments []SwaggerComment) { |
| 231 | m := map[string]struct{}{} |
| 232 | |
| 233 | for _, c := range comments { |
| 234 | key := c.method + " " + c.router |
| 235 | _, alreadyDefined := m[key] |
| 236 | assert.False(t, alreadyDefined, "defined route must be unique (method: %s, route: %s)", c.method, c.router) |
| 237 | if !alreadyDefined { |
| 238 | m[key] = struct{}{} |
| 239 | } |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | var uniqueAnnotations = []string{"@ID", "@Summary", "@Tags", "@Router"} |
| 244 |
no outgoing calls
no test coverage detected