Skip to content

Commit 89f9534

Browse files
committed
Remove unnecessary output return value
1 parent 92e2e4d commit 89f9534

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

ansible/ansible.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ func (ansible *Ansible) Install(osName, sudoPassword string) (err error) {
4040
}
4141

4242
printer.Printf("\n<comment>$ %s</comment>\n", processes[0].String())
43-
if _, err = processes[0].Run(); err != nil {
43+
if err = processes[0].Run(); err != nil {
4444
var exitError *exec.ExitError
4545
if errors.As(err, &exitError) && exitError.ExitCode() == 100 {
4646
printer.Printf("\n<comment>$ %s</comment>\n", processes[1].String())
47-
if _, err = processes[1].Run(); err != nil {
47+
if err = processes[1].Run(); err != nil {
4848
return err
4949
}
5050
} else {
@@ -53,12 +53,12 @@ func (ansible *Ansible) Install(osName, sudoPassword string) (err error) {
5353
}
5454

5555
printer.Printf("\n<comment>$ %s</comment>\n", processes[2].String())
56-
if _, err = processes[2].Run(); nil != err {
56+
if err = processes[2].Run(); nil != err {
5757
return err
5858
}
5959

6060
printer.Printf("\n<comment>$ %s</comment>\n", processes[3].String())
61-
if _, err = processes[3].Run(); nil != err {
61+
if err = processes[3].Run(); nil != err {
6262
return err
6363
}
6464
default:
@@ -88,7 +88,7 @@ func (ansible *Ansible) RunAnsiblePlaybook(playbookFilePath, variableFilePath, s
8888
}
8989

9090
printer.Printf("\n<comment>$ %s</comment>\n", proc.String())
91-
if _, err = proc.Run(); nil != err {
91+
if err = proc.Run(); nil != err {
9292
return err
9393
}
9494

process/process.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ func NewWslSudoProcess(distribution string, arguments ...string) *Process {
3737
return New(arguments...).AddPreArguments("wsl", "-d", distribution, "-u", "root")
3838
}
3939

40-
func (p *Process) Run() (out string, err error) {
40+
func (p *Process) Run() (err error) {
4141
cmd := p.newCommand()
4242
cmd.Stdout = os.Stdout
4343
cmd.Stdin = os.Stdin
4444
cmd.Stderr = os.Stderr
4545

4646
if err = cmd.Run(); err != nil {
47-
return "", err
47+
return err
4848
}
4949

50-
return "", nil
50+
return nil
5151
}
5252

5353
func (p *Process) Output() (out string, err error) {

wsl/wsl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func createWslConfFile(distribution string) (err error) {
8282
process.NewWslSudoProcess(distribution, "bash", "-c", "echo >> /etc/wsl.conf"),
8383
}
8484
for _, proc := range processes {
85-
if _, err = proc.Run(); err != nil {
85+
if err = proc.Run(); err != nil {
8686
return err
8787
}
8888
}
@@ -128,7 +128,7 @@ func updateWslConfFile(distribution, content string) (modified bool, err error)
128128
}
129129

130130
cmd := fmt.Sprintf("echo %q %s /etc/wsl.conf", line, strings.Repeat(">", operatorCount))
131-
if _, err = process.NewWslSudoProcess(distribution, "bash", "-c", cmd).Run(); err != nil {
131+
if err = process.NewWslSudoProcess(distribution, "bash", "-c", cmd).Run(); err != nil {
132132
return modified, err
133133
}
134134
}

0 commit comments

Comments
 (0)