From c3629bdbb5f6438199bfe3b9aa32273083b4cbed Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Wed, 14 Oct 2020 21:33:51 +0200 Subject: [PATCH] Remove ineffectual assignments --- auth/auth.go | 2 +- internal/config/config.go | 3 +++ stream/srt/srt_test.go | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/auth/auth.go b/auth/auth.go index 9652e3c..ba30a8b 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -26,7 +26,7 @@ type Backend interface { // New initialize authentification backend func New(cfg *Options) (Backend, error) { - var backend Backend = nil + var backend Backend var err error if !cfg.Enabled { diff --git a/internal/config/config.go b/internal/config/config.go index eda6c5c..09edec7 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -85,6 +85,9 @@ func Load() (*Config, error) { configuro.WithLoadFromConfigFile("/etc/ghostream/ghostream.yml", false), configuro.WithEnvConfigPathOverload("GHOSTREAM_CONFIG"), ) + if err != nil { + return nil, err + } // Load default configuration cfg := New() diff --git a/stream/srt/srt_test.go b/stream/srt/srt_test.go index 1d09d00..37f44f5 100644 --- a/stream/srt/srt_test.go +++ b/stream/srt/srt_test.go @@ -28,13 +28,13 @@ func TestSplitHostPort(t *testing.T) { } // Split demo, should fail - host, port, err = splitHostPort("demo") + _, _, err = splitHostPort("demo") if err == nil { t.Errorf("splitHostPort managed to split unsplitable hostport") } // Split demo:port, should fail - host, port, err = splitHostPort("demo:port") + _, _, err = splitHostPort("demo:port") if err == nil { t.Errorf("splitHostPort managed to split unsplitable hostport") }