Skip to content

Commit

Permalink
chore: fix linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
  • Loading branch information
nikpivkin committed Sep 16, 2024
1 parent b107f71 commit d8debf0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pkg/iac/scanners/dockerfile/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import (
"github.com/aquasecurity/trivy/pkg/iac/types"
)

func NewScanner(options ...options.ScannerOption) *generic.GenericScanner {
return generic.NewScanner("Dockerfile", types.SourceDockerfile, generic.ParseFunc(parser.Parse), options...)
func NewScanner(opts ...options.ScannerOption) *generic.GenericScanner {
return generic.NewScanner("Dockerfile", types.SourceDockerfile, generic.ParseFunc(parser.Parse), opts...)
}
18 changes: 9 additions & 9 deletions pkg/iac/scanners/generic/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ import (
"github.com/aquasecurity/trivy/pkg/log"
)

func NewJsonScanner(options ...options.ScannerOption) *GenericScanner {
return NewScanner("JSON", types.SourceJSON, ParseFunc(parseJson), options...)
func NewJsonScanner(opts ...options.ScannerOption) *GenericScanner {
return NewScanner("JSON", types.SourceJSON, ParseFunc(parseJson), opts...)
}

func NewYamlScanner(options ...options.ScannerOption) *GenericScanner {
return NewScanner("YAML", types.SourceYAML, ParseFunc(parseYaml), options...)
func NewYamlScanner(opts ...options.ScannerOption) *GenericScanner {
return NewScanner("YAML", types.SourceYAML, ParseFunc(parseYaml), opts...)
}

func NewTomlScanner(options ...options.ScannerOption) *GenericScanner {
return NewScanner("TOML", types.SourceTOML, ParseFunc(parseTOML), options...)
func NewTomlScanner(opts ...options.ScannerOption) *GenericScanner {
return NewScanner("TOML", types.SourceTOML, ParseFunc(parseTOML), opts...)
}

type configParser interface {
Expand Down Expand Up @@ -62,16 +62,16 @@ func (f ParseFunc) Parse(ctx context.Context, r io.Reader, path string) (any, er
return f(ctx, r, path)
}

func NewScanner(name string, source types.Source, parser configParser, options ...options.ScannerOption) *GenericScanner {
func NewScanner(name string, source types.Source, parser configParser, opts ...options.ScannerOption) *GenericScanner {
s := &GenericScanner{
name: name,
options: options,
options: opts,
source: source,
logger: log.WithPrefix(fmt.Sprintf("%s scanner", source)),
parser: parser,
}

for _, opt := range options {
for _, opt := range opts {
opt(s)
}

Expand Down

0 comments on commit d8debf0

Please sign in to comment.