Skip to content

Commit

Permalink
refactor(go): remove Compiler.IgnoreModule from the public API.
Browse files Browse the repository at this point in the history
The same thing can be achieved by using the `IgnoreModule` option when creating the compiler. For simplicity and consistency let's have a single way to do this.
  • Loading branch information
plusvic committed Sep 5, 2024
1 parent 003e0cb commit 5b60613
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func NewCompiler(opts... CompileOption) (*Compiler, error) {

func (c *Compiler) initialize() error {
for name, _ := range c.ignoredModules {
c.IgnoreModule(name)
c.ignoreModule(name)
}
for ident, value := range c.vars {
if err := c.DefineGlobal(ident, value); err != nil {
Expand Down Expand Up @@ -273,12 +273,12 @@ func (c *Compiler) AddSource(src string, opts... SourceOption) error {
return nil
}

// IgnoreModule tells the compiler to ignore the module with the given name.
// ignoreModule tells the compiler to ignore the module with the given name.
//
// Any YARA rule using the module will be ignored, as well as rules that depends
// on some other rule that uses the module. The compiler will issue warnings
// about the ignored rules, but otherwise the compilation will succeed.
func (c *Compiler) IgnoreModule(module string) {
func (c *Compiler) ignoreModule(module string) {
cModule := C.CString(module)
defer C.free(unsafe.Pointer(cModule))
result := C.yrx_compiler_ignore_module(c.cCompiler, cModule)
Expand Down

0 comments on commit 5b60613

Please sign in to comment.