From e0d0584d0b121e1212bbfa43b56d3efbfe9419e9 Mon Sep 17 00:00:00 2001 From: Jake Correnti Date: Thu, 17 Aug 2023 09:33:01 -0400 Subject: [PATCH] Fix golangci-lint errors Fixes golangci-lint errors introduced by #258 Signed-off-by: Jake Correnti --- pkg/types/command.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/types/command.go b/pkg/types/command.go index 5ebca3a2c..3943fdac7 100644 --- a/pkg/types/command.go +++ b/pkg/types/command.go @@ -85,11 +85,7 @@ func (c *Command) AddVfkitSocket(socket string) { } func (c *Command) addForwardInfo(flag, value string) { - if _, ok := c.forwardInfo[flag]; ok { - c.forwardInfo[flag] = append(c.forwardInfo[flag], value) - } else { - c.forwardInfo[flag] = []string{value} - } + c.forwardInfo[flag] = append(c.forwardInfo[flag], value) } func (c *Command) AddForwardSock(socket string) { @@ -189,5 +185,5 @@ func (c *Command) ToCmdline() []string { // Cmd converts Command to a commandline format and returns an exec.Cmd which // can be executed by os/exec func (c *Command) Cmd(gvproxyPath string) *exec.Cmd { - return exec.Command(gvproxyPath, c.ToCmdline()...) + return exec.Command(gvproxyPath, c.ToCmdline()...) // nolint:gosec }