Skip to content

Commit

Permalink
update error msg
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <[email protected]>
  • Loading branch information
Two-Hearts committed Dec 12, 2023
1 parent dd24043 commit 1fca1b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugin/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func parsePluginFromDir(path string) (string, string, error) {
}
if isExec {
if foundPluginExecutableFile {
return fmt.Errorf("found more than one plugin executable files under %s", path)
return errors.New("found more than one plugin executable files")
}
foundPluginExecutableFile = true
pluginExecutableFile = p
Expand All @@ -260,7 +260,7 @@ func parsePluginFromDir(path string) (string, string, error) {
return "", "", err
}
if !foundPluginExecutableFile {
return "", "", fmt.Errorf("no plugin executable file was found under %s", path)
return "", "", errors.New("no plugin executable file was found")
}
return pluginExecutableFile, pluginName, nil
}
4 changes: 2 additions & 2 deletions plugin/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func TestManager_Install(t *testing.T) {
installOpts := CLIInstallOptions{
PluginPath: newPluginDir,
}
expectedErrorMsg := "failed to parse plugin from directory testdata/foo: no plugin executable file was found under testdata/foo"
expectedErrorMsg := "failed to parse plugin from directory testdata/foo: no plugin executable file was found"
_, _, err := mgr.Install(context.Background(), installOpts)
if err == nil || err.Error() != expectedErrorMsg {
t.Fatalf("expecting error %s, but got %v", expectedErrorMsg, err)
Expand Down Expand Up @@ -461,7 +461,7 @@ func TestManager_Install(t *testing.T) {
installOpts := CLIInstallOptions{
PluginPath: newPluginDir,
}
expectedErrorMsg := "failed to parse plugin from directory testdata/foo: found more than one plugin executable files under testdata/foo"
expectedErrorMsg := "failed to parse plugin from directory testdata/foo: found more than one plugin executable files"
_, _, err := mgr.Install(context.Background(), installOpts)
if err == nil || err.Error() != expectedErrorMsg {
t.Fatalf("expecting error %s, but got %v", expectedErrorMsg, err)
Expand Down

0 comments on commit 1fca1b4

Please sign in to comment.