@@ -76,7 +76,7 @@ func WithPlugins(plugins ...plugin.Plugin) Option {
76
76
return fmt .Errorf ("two plugins have the same key: %q" , key )
77
77
}
78
78
if err := plugin .Validate (p ); err != nil {
79
- return fmt .Errorf ("broken pre-set plugin %q: %v " , key , err )
79
+ return fmt .Errorf ("broken pre-set plugin %q: %w " , key , err )
80
80
}
81
81
c .plugins [key ] = p
82
82
}
@@ -97,7 +97,7 @@ func WithDefaultPlugins(projectVersion config.Version, plugins ...plugin.Plugin)
97
97
}
98
98
for _ , p := range plugins {
99
99
if err := plugin .Validate (p ); err != nil {
100
- return fmt .Errorf ("broken pre-set default plugin %q: %v " , plugin .KeyFor (p ), err )
100
+ return fmt .Errorf ("broken pre-set default plugin %q: %w " , plugin .KeyFor (p ), err )
101
101
}
102
102
if ! plugin .SupportsVersion (p , projectVersion ) {
103
103
return fmt .Errorf ("default plugin %q doesn't support version %q" , plugin .KeyFor (p ), projectVersion )
@@ -114,7 +114,7 @@ func WithDefaultPlugins(projectVersion config.Version, plugins ...plugin.Plugin)
114
114
func WithDefaultProjectVersion (version config.Version ) Option {
115
115
return func (c * CLI ) error {
116
116
if err := version .Validate (); err != nil {
117
- return fmt .Errorf ("broken pre-set default project version %q: %v " , version , err )
117
+ return fmt .Errorf ("broken pre-set default project version %q: %w " , version , err )
118
118
}
119
119
c .defaultProjectVersion = version
120
120
return nil
@@ -209,7 +209,7 @@ func getPluginsRoot(host string) (pluginsRoot string, err error) {
209
209
return "" , fmt .Errorf ("the specified path %s does not exist" , pluginsPath )
210
210
}
211
211
// some other error
212
- return "" , fmt .Errorf ("error checking the path: %v " , err )
212
+ return "" , fmt .Errorf ("error checking the path: %w " , err )
213
213
}
214
214
// the path exists
215
215
return pluginsPath , nil
@@ -232,7 +232,7 @@ func getPluginsRoot(host string) (pluginsRoot string, err error) {
232
232
233
233
userHomeDir , err := os .UserHomeDir ()
234
234
if err != nil {
235
- return "" , fmt .Errorf ("error retrieving home dir: %v " , err )
235
+ return "" , fmt .Errorf ("error retrieving home dir: %w " , err )
236
236
}
237
237
238
238
return filepath .Join (userHomeDir , pluginsRoot ), nil
@@ -294,13 +294,13 @@ func DiscoverExternalPlugins(filesystem afero.Fs) (ps []plugin.Plugin, err error
294
294
// for example: sample.sh --> sample, externalplugin.py --> externalplugin
295
295
trimmedPluginName := strings .Split (pluginFile .Name (), "." )
296
296
if trimmedPluginName [0 ] == "" {
297
- return nil , fmt .Errorf ("Invalid plugin name found %q" , pluginFile .Name ())
297
+ return nil , fmt .Errorf ("invalid plugin name found %q" , pluginFile .Name ())
298
298
}
299
299
300
300
if pluginFile .Name () == pluginInfo .Name () || trimmedPluginName [0 ] == pluginInfo .Name () {
301
301
// check whether the external plugin is an executable.
302
302
if ! isPluginExecutable (pluginFile .Mode ()) {
303
- return nil , fmt .Errorf ("External plugin %q found in path is not an executable" , pluginFile .Name ())
303
+ return nil , fmt .Errorf ("external plugin %q found in path is not an executable" , pluginFile .Name ())
304
304
}
305
305
306
306
ep := external.Plugin {
0 commit comments