From 138745a6b14f0e511e47a34f25f4a19abbe56c1c Mon Sep 17 00:00:00 2001 From: forgedhallpass <13679401+forgedhallpass@users.noreply.github.com> Date: Tue, 3 Aug 2021 15:39:15 +0300 Subject: [PATCH] RES-84 # Improve Nuclei CLI interface (WIP) * Pleasing the linter --- v2/pkg/model/model.go | 3 ++- v2/pkg/parsers/parser.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/v2/pkg/model/model.go b/v2/pkg/model/model.go index 3063da9dc..095fcf246 100644 --- a/v2/pkg/model/model.go +++ b/v2/pkg/model/model.go @@ -2,10 +2,10 @@ package model import ( "fmt" - "github.com/projectdiscovery/nuclei/v2/pkg/utils" "strings" "github.com/projectdiscovery/nuclei/v2/internal/severity" + "github.com/projectdiscovery/nuclei/v2/pkg/utils" ) type Info struct { @@ -47,6 +47,7 @@ func (stringSlice *StringSlice) UnmarshalYAML(unmarshal func(interface{}) error) } result := make([]string, len(marshalledSlice)) + //nolint:gosimple,nolintlint //cannot be replaced with result = append(result, slices...) because the values are being normalized for _, value := range marshalledSlice { result = append(result, strings.ToLower(strings.TrimSpace(value))) // TODO do we need to introduce RawStringSlice and/or NormalizedStringSlices? } diff --git a/v2/pkg/parsers/parser.go b/v2/pkg/parsers/parser.go index 9c0ef36a3..634c030ea 100644 --- a/v2/pkg/parsers/parser.go +++ b/v2/pkg/parsers/parser.go @@ -62,7 +62,7 @@ func isInfoMetadataMatch(tagFilter *filter.TagFilter, templateInfo *model.Info, } func validateMandatoryInfoFields(info *model.Info) error { - if &info == nil { + if info == nil { return fmt.Errorf(mandatoryFieldMissingTemplate, "info") }