From 55614a7f284df04d89bc27d0c46cc62c9b91eb76 Mon Sep 17 00:00:00 2001 From: Kent Gruber Date: Tue, 1 May 2018 23:21:54 -0400 Subject: [PATCH] if block ends with a return statement drop this else and outdent its block --- modules/http_proxy_base.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/http_proxy_base.go b/modules/http_proxy_base.go index 38ba658f..600f0ead 100644 --- a/modules/http_proxy_base.go +++ b/modules/http_proxy_base.go @@ -115,9 +115,8 @@ func (p *HTTPProxy) Configure(address string, proxyPort int, httpPort int, scrip if scriptPath != "" { if err, p.Script = LoadHttpProxyScript(scriptPath, p.sess); err != nil { return err - } else { - log.Debug("Proxy script %s loaded.", scriptPath) } + log.Debug("Proxy script %s loaded.", scriptPath) } p.Server = &http.Server{ @@ -336,9 +335,9 @@ func (p *HTTPProxy) Stop() error { p.isRunning = false p.sniListener.Close() return nil - } else { - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - return p.Server.Shutdown(ctx) } + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + return p.Server.Shutdown(ctx) }