From 32b14a3723cad8502ea6a9ae81bb277515bc04e0 Mon Sep 17 00:00:00 2001 From: Punya Biswal Date: Tue, 28 Sep 2021 10:05:33 -0400 Subject: [PATCH] Use invoke.CommandWithContext --- mem/mem_bsd.go | 2 +- mem/mem_solaris.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mem/mem_bsd.go b/mem/mem_bsd.go index a82fddb..17ca920 100644 --- a/mem/mem_bsd.go +++ b/mem/mem_bsd.go @@ -28,7 +28,7 @@ func SwapDevicesWithContext(ctx context.Context) ([]*SwapDevice, error) { if err != nil { return nil, fmt.Errorf("could not find command %q: %w", swapCommand, err) } - output, err := exec.Command(swapCommandPath, "-lk").Output() + output, err := invoke.CommandWithContext(swapCommandPath, "-lk") if err != nil { return nil, fmt.Errorf("could not execute %q: %w", swapCommand, err) } diff --git a/mem/mem_solaris.go b/mem/mem_solaris.go index 353d4cf..0c58314 100644 --- a/mem/mem_solaris.go +++ b/mem/mem_solaris.go @@ -145,7 +145,7 @@ func SwapDevicesWithContext(ctx context.Context) ([]*SwapDevice, error) { if err != nil { return nil, fmt.Errorf("could not find command %q: %w", swapCommand, err) } - output, err := exec.Command(swapsCommandPath, "-l").Output() + output, err := invoke.CommandWithContext(swapsCommandPath, "-l") if err != nil { return nil, fmt.Errorf("could not execute %q: %w", swapsCommand, err) }