(path string)
| 45 | } |
| 46 | |
| 47 | func pluginIDFromPath(path string) string { |
| 48 | file, ok := pluginFileFromPath(path, "") |
| 49 | if ok { |
| 50 | return file.ID |
| 51 | } |
| 52 | base := filepath.Base(path) |
| 53 | lowerBase := strings.ToLower(base) |
| 54 | for _, extension := range []string{".so", ".dylib", ".dll"} { |
| 55 | if strings.HasSuffix(lowerBase, extension) { |
| 56 | return base[:len(base)-len(extension)] |
| 57 | } |
| 58 | } |
| 59 | return base |
| 60 | } |
| 61 | |
| 62 | func pluginFileFromPath(filePath string, requiredExtension string) (pluginFile, bool) { |
| 63 | base := filepath.Base(filePath) |