From c9e201a16322b65a603e74e9b772a3a35d72ec47 Mon Sep 17 00:00:00 2001 From: Albert Ho Date: Wed, 14 Aug 2024 17:32:50 -0700 Subject: [PATCH] rm nil check --- binding/go/porcupine.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/binding/go/porcupine.go b/binding/go/porcupine.go index f7fd29f22..9bb85c0d9 100644 --- a/binding/go/porcupine.go +++ b/binding/go/porcupine.go @@ -218,8 +218,7 @@ func (porcupine *Porcupine) Init() error { Message: fmt.Sprintf("Specified model file could not be found at %s", porcupine.ModelPath)} } - //nolint:nilcheck - if porcupine.BuiltInKeywords != nil && len(porcupine.BuiltInKeywords) > 0 { + if len(porcupine.BuiltInKeywords) > 0 { for _, keyword := range porcupine.BuiltInKeywords { if !keyword.IsValid() { return &PorcupineError{ @@ -231,8 +230,7 @@ func (porcupine *Porcupine) Init() error { } } - //nolint:nilcheck - if porcupine.KeywordPaths == nil || len(porcupine.KeywordPaths) == 0 { + if len(porcupine.KeywordPaths) == 0 { return &PorcupineError{ StatusCode: INVALID_ARGUMENT, Message: "No valid keywords were provided"}