Skip to content

Commit 32b14a3

Browse files
committed
Use invoke.CommandWithContext
1 parent 5169bfe commit 32b14a3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mem/mem_bsd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func SwapDevicesWithContext(ctx context.Context) ([]*SwapDevice, error) {
2828
if err != nil {
2929
return nil, fmt.Errorf("could not find command %q: %w", swapCommand, err)
3030
}
31-
output, err := exec.Command(swapCommandPath, "-lk").Output()
31+
output, err := invoke.CommandWithContext(swapCommandPath, "-lk")
3232
if err != nil {
3333
return nil, fmt.Errorf("could not execute %q: %w", swapCommand, err)
3434
}

mem/mem_solaris.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func SwapDevicesWithContext(ctx context.Context) ([]*SwapDevice, error) {
145145
if err != nil {
146146
return nil, fmt.Errorf("could not find command %q: %w", swapCommand, err)
147147
}
148-
output, err := exec.Command(swapsCommandPath, "-l").Output()
148+
output, err := invoke.CommandWithContext(swapsCommandPath, "-l")
149149
if err != nil {
150150
return nil, fmt.Errorf("could not execute %q: %w", swapsCommand, err)
151151
}

0 commit comments

Comments
 (0)