Skip to content

Commit

Permalink
introduce constructor func for ScanOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
patilpankaj212 committed Dec 22, 2020
1 parent 71645d2 commit e90045c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ type ScanOptions struct {
Verbose bool
}

// NewScanOptions returns a new pointer to ScanOptions
func NewScanOptions() *ScanOptions {
return new(ScanOptions)
}

// Scan executes the terrascan scan command
func (s *ScanOptions) Scan() error {
if err := s.Init(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"go.uber.org/zap"
)

var scanOptions = new(ScanOptions)
var scanOptions = NewScanOptions()

var scanCmd = &cobra.Command{
Use: "scan",
Expand Down

0 comments on commit e90045c

Please sign in to comment.