From bfa6b9dcef7592e6dd8225aaa0d0ab5aef5b3f84 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sun, 9 Mar 2025 20:14:46 -0400 Subject: chore(refactoring): Refactor/modernizations (#2345) chore(refactoring): Refactor with modernization refactorings * range over int * replace interface{} with any * replace common map operations with maps.Copy/maps.Clone * simplifying loops with slices.Contains/ContainsFunc * modernize benchmarks with b.Loop * modernize tests with t.Context * use fmt.Appendf * range over strings.SplitSeq * use new stdlib crypto/pbkdf2 package --------- Signed-off-by: Dave Henderson --- plugins.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins.go') diff --git a/plugins.go b/plugins.go index fd2882ab..d87f2a64 100644 --- a/plugins.go +++ b/plugins.go @@ -64,7 +64,7 @@ type PluginOpts struct { // PluginFunc creates a template function that runs an external process - either // a shell script or commandline executable. -func PluginFunc(ctx context.Context, cmd string, opts PluginOpts) func(...interface{}) (interface{}, error) { +func PluginFunc(ctx context.Context, cmd string, opts PluginOpts) func(...any) (any, error) { timeout := opts.Timeout if timeout == 0 { timeout = 5 * time.Second @@ -126,7 +126,7 @@ func findPowershell() string { return "pwsh" } -func (p *plugin) run(args ...interface{}) (interface{}, error) { +func (p *plugin) run(args ...any) (any, error) { a := conv.ToStrings(args...) a = append(p.args, a...) -- cgit v1.2.3