github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/pkg/scanners/options/parser.go (about)

     1  package options
     2  
     3  import "io"
     4  
     5  type ConfigurableParser interface {
     6  	SetDebugWriter(io.Writer)
     7  	SetSkipRequiredCheck(bool)
     8  }
     9  
    10  type ParserOption func(s ConfigurableParser)
    11  
    12  func ParserWithSkipRequiredCheck(skip bool) ParserOption {
    13  	return func(s ConfigurableParser) {
    14  		s.SetSkipRequiredCheck(skip)
    15  	}
    16  }
    17  
    18  // ParserWithDebug specifies an io.Writer for debug logs - if not set, they are discarded
    19  func ParserWithDebug(w io.Writer) ParserOption {
    20  	return func(s ConfigurableParser) {
    21  		s.SetDebugWriter(w)
    22  	}
    23  }