Skip to content

Commit

Permalink
rm nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
albho committed Aug 15, 2024
1 parent 34a62c3 commit c9e201a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions binding/go/porcupine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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"}
Expand Down

0 comments on commit c9e201a

Please sign in to comment.