<commit_before>![Logo](/goyara-logo.png)

# go-yara

[![GoDoc](https://godoc.org/github.com/hillu/go-yara?status.svg)](https://godoc.org/github.com/hillu/go-yara)
[![Travis](https://travis-ci.org/hillu/go-yara.svg?branch=master)](https://travis-ci.org/hillu/go-yara)
[![Go Report Card](https://goreportcard.com/badge/github.com/hillu/go-yara)](https://goreportcard.com/report/github.com/hillu/go-yara)

Go bindings for [YARA](https://virustotal.github.io/yara/), staying as
close as sensible to the library's C-API while taking inspiration from
the `yara-python` implementation.

## Build/Installation

On a Unix system with _libyara_ version 4, corresponding header files,
and _pkg-config_ installed, just do:

```
go get github.com/hillu/go-yara
go install github.com/hillu/go-yara
```

If _libyara_ has been installed to a custom location, the
`PKG_CONFIG_PATH` environment variable can be used to point<commit_msg>README: Fix path for v4, mention Go modules<commit_after>![Logo](/goyara-logo.png)

# go-yara

[![GoDoc](https://godoc.org/github.com/hillu/go-yara?status.svg)](https://godoc.org/github.com/hillu/go-yara)
[![Travis](https://travis-ci.org/hillu/go-yara.svg?branch=master)](https://travis-ci.org/hillu/go-yara)
[![Go Report Card](https://goreportcard.com/badge/github.com/hillu/go-yara)](https://goreportcard.com/report/github.com/hillu/go-yara)

Go bindings for [YARA](https://virustotal.github.io/yara/), staying as
close as sensible to the library's C-API while taking inspiration from
the `yara-python` implementation.

## Build/Installation

On y Unix system, _libyara_ version 4, corresponding header files, and
_pkg-config_ must be installed. Adding _go-yara_ v4 to a project with
Go Modules enabled, simply add the proper dependency…

``` go
import "github.com/hillu/go-yara/v4"
```

…and rebuild your package.

To install _go-yara_ v4 to GOPATH, do:

```
go get github.com/hillu/go-yara/v4
go install github.com/hillu/go-yara/v4
```

If _libyara_ has been installed to a custom location, the
`PKG_CONFIG_PATH` environment variable can be used to point
{'fraction_non_alphanumeric': 0.14884393063583815, 'fraction_numerical': 0.0038535645472061657, 'mean_word_length': 4.867231638418079, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7330484', 'n_tokens_mistral': 783, 'n_tokens_neox': 759, 'n_words': 170}