(path string)
| 455 | } |
| 456 | |
| 457 | func pluginIDFromPath(path string) string { |
| 458 | file, ok := pluginFileInfoFromPath(path, "") |
| 459 | if ok { |
| 460 | return file.ID |
| 461 | } |
| 462 | base := filepath.Base(path) |
| 463 | lowerBase := strings.ToLower(base) |
| 464 | for _, extension := range []string{".so", ".dylib", ".dll"} { |
| 465 | if strings.HasSuffix(lowerBase, extension) { |
| 466 | return base[:len(base)-len(extension)] |
| 467 | } |
| 468 | } |
| 469 | return base |
| 470 | } |
| 471 | |
| 472 | func pluginFileInfoFromPath(filePath string, requiredExtension string) (pluginFileInfo, bool) { |
| 473 | base := filepath.Base(filePath) |
nothing calls this directly
no test coverage detected