RES-84 # Improve Nuclei CLI interface (WIP)

* Pleasing the linter
This commit is contained in:
forgedhallpass 2021-08-03 15:39:15 +03:00
parent d3154648d2
commit 138745a6b1
2 changed files with 3 additions and 2 deletions

View File

@ -2,10 +2,10 @@ package model
import ( import (
"fmt" "fmt"
"github.com/projectdiscovery/nuclei/v2/pkg/utils"
"strings" "strings"
"github.com/projectdiscovery/nuclei/v2/internal/severity" "github.com/projectdiscovery/nuclei/v2/internal/severity"
"github.com/projectdiscovery/nuclei/v2/pkg/utils"
) )
type Info struct { type Info struct {
@ -47,6 +47,7 @@ func (stringSlice *StringSlice) UnmarshalYAML(unmarshal func(interface{}) error)
} }
result := make([]string, len(marshalledSlice)) 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 { for _, value := range marshalledSlice {
result = append(result, strings.ToLower(strings.TrimSpace(value))) // TODO do we need to introduce RawStringSlice and/or NormalizedStringSlices? result = append(result, strings.ToLower(strings.TrimSpace(value))) // TODO do we need to introduce RawStringSlice and/or NormalizedStringSlices?
} }

View File

@ -62,7 +62,7 @@ func isInfoMetadataMatch(tagFilter *filter.TagFilter, templateInfo *model.Info,
} }
func validateMandatoryInfoFields(info *model.Info) error { func validateMandatoryInfoFields(info *model.Info) error {
if &info == nil { if info == nil {
return fmt.Errorf(mandatoryFieldMissingTemplate, "info") return fmt.Errorf(mandatoryFieldMissingTemplate, "info")
} }