(plugs []Plugin)
| 271 | } |
| 272 | |
| 273 | func detectDuplicates(plugs []Plugin) error { |
| 274 | names := map[string]string{} |
| 275 | |
| 276 | for _, plug := range plugs { |
| 277 | if oldpath, ok := names[plug.Metadata().Name]; ok { |
| 278 | return fmt.Errorf( |
| 279 | "two plugins claim the name %q at %q and %q", |
| 280 | plug.Metadata().Name, |
| 281 | oldpath, |
| 282 | plug.Dir(), |
| 283 | ) |
| 284 | } |
| 285 | names[plug.Metadata().Name] = plug.Dir() |
| 286 | } |
| 287 | |
| 288 | return nil |
| 289 | } |
searching dependent graphs…