(path string)
| 371 | } |
| 372 | |
| 373 | func pluginIDFromPath(path string) string { |
| 374 | file, ok := pluginFileFromPath(path, "") |
| 375 | if ok { |
| 376 | return file.ID |
| 377 | } |
| 378 | base := filepath.Base(path) |
| 379 | lowerBase := strings.ToLower(base) |
| 380 | for _, extension := range []string{".so", ".dylib", ".dll"} { |
| 381 | if strings.HasSuffix(lowerBase, extension) { |
| 382 | return base[:len(base)-len(extension)] |
| 383 | } |
| 384 | } |
| 385 | return base |
| 386 | } |
| 387 | |
| 388 | func pluginFileFromPath(filePath string, requiredExtension string) (pluginFileInfo, bool) { |
| 389 | base := filepath.Base(filePath) |
nothing calls this directly
no test coverage detected