From 4f44a2a11f153665826de006c01f78ba36d3511c Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sat, 31 Aug 2024 21:11:54 +0200 Subject: [PATCH] cleaner return after nil error --- proxy/util.go | 6 +----- util/command.go | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/proxy/util.go b/proxy/util.go index bbc1e7d..1984d65 100644 --- a/proxy/util.go +++ b/proxy/util.go @@ -100,9 +100,5 @@ func SetSystemProxy(state bool) error { } err = key.SetDWordValue("proxyEnable", value) - if err != nil { - return err - } - - return nil + return err } diff --git a/util/command.go b/util/command.go index a946fab..ae56898 100644 --- a/util/command.go +++ b/util/command.go @@ -32,11 +32,7 @@ func ReadyCmd() (*io.WriteCloser, func() error, error) { // Wait for command to flush err := cmd.Wait() - if err != nil { - return err - } - - return nil + return err }, nil }