changed import conventions for plugin names: expr-<scoped-name>; scoped-name = <scope>-<name>

This commit is contained in:
2026-05-22 05:59:46 +02:00
parent ac5c97bfd3
commit 7ed5a806f9
3 changed files with 9 additions and 10 deletions
-2
View File
@@ -1,4 +1,2 @@
github.com/yqylovy/goimportdot v0.0.0-20170519021755-eb181a7eeabe h1:bWYrKmmfv37uNgXTdwkLSKYiYPJ1yfWmjBnvtMyAYzk=
github.com/yqylovy/goimportdot v0.0.0-20170519021755-eb181a7eeabe/go.mod h1:alTKUpAJ/zbp17qvZwcFNwzufrb5DljMDY4mgJlIHao=
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d h1:0olWaB5pg3+oychR51GUVCEsGkeCU/2JxjBgIo4f3M0=
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
+7 -6
View File
@@ -89,16 +89,17 @@ func searchAmongPath(filename string, dirList []string) (filePath string) {
if dir, err = util.ExpandPath(dir); err != nil {
continue
}
if fullPath := path.Join(dir, filename); isFile(fullPath) {
fullPath := path.Join(dir, filename)
if isFile(fullPath) {
filePath = fullPath
break
}
subdir := strings.TrimSuffix(filename, suffix)
if fullPath := path.Join(dir, subdir, filename); isFile(fullPath) {
filePath = fullPath
break
}
// subdir := strings.TrimSuffix(filename, suffix)
// if fullPath := path.Join(dir, subdir, filename); isFile(fullPath) {
// filePath = fullPath
// break
// }
}
return
}
+2 -2
View File
@@ -33,9 +33,9 @@ func pluginExists(name string) (exists bool) {
func makePluginName(name string) (decorated string) {
var template string
if execName, err := os.Executable(); err != nil || !strings.Contains(execName, "debug") {
template = "expr-%s-plugin%s"
template = "expr-%s%s"
} else {
template = "expr-%s-plugin%s.debug"
template = "expr-%s%s.debug"
}
decorated = fmt.Sprintf(template, name, SHAREDLIBRARY_EXTENSION)
return