<commit_before># gomock

[![Build Status][ci-badge]][ci-runs] [![Go Reference][reference-badge]][reference]

gomock is a mocking framework for the [Go programming language][golang]. It
integrates well with Go's built-in `testing` package, but can be used in other
contexts too.

## Installation

Once you have [installed Go][golang-install], install the `mockgen` tool.

**Note**: If you have not done so already be sure to add `$GOPATH/bin` to your
`PATH`.

To get the latest released version use:

### Go version < 1.16

```bash
GO111MODULE=on go get github.com/golang/mock/mockgen@v1.6.0
```

### Go 1.16+

```bash
go install github.com/golang/mock/mockgen@v1.6.0
```

If you use `mockgen` in your CI pipeline, it may be more appropriate to fixate
on a specific mockgen version.

## Running mockgen

`mockgen` has two modes of operation: source and reflect.

### Source mode

Source mode generates mock interfaces from a source file.
It is enabled by using the -source flag. Other flags that
may be useful in this mode are -imports and -aux_files.

Example:

```bash
mockgen -source=foo.go [other options]
```

### Reflect mode

Reflect mode generates mock interfaces by building a program<commit_msg>add note on keeping mockgen in sync /w lib version<commit_after># gomock

[![Build Status][ci-badge]][ci-runs] [![Go Reference][reference-badge]][reference]

gomock is a mocking framework for the [Go programming language][golang]. It
integrates well with Go's built-in `testing` package, but can be used in other
contexts too.

## Installation

Once you have [installed Go][golang-install], install the `mockgen` tool.

**Note**: If you have not done so already be sure to add `$GOPATH/bin` to your
`PATH`.

To get the latest released version use:

### Go version < 1.16

```bash
GO111MODULE=on go get github.com/golang/mock/mockgen@v1.6.0
```

### Go 1.16+

```bash
go install github.com/golang/mock/mockgen@v1.6.0
```

If you use `mockgen` in your CI pipeline, it may be more appropriate to fixate
on a specific mockgen version. You should try to keep the library in sync with
the version of mockgen used to generate your mocks.

## Running mockgen

`mockgen` has two modes of operation: source and reflect.

### Source mode

Source mode generates mock interfaces from a source file.
It is enabled by using the -source flag. Other flags that
may be useful in this mode are -imports and -aux_files.

Example:

```bash
mockgen -source=foo.go [other options]
```

### Reflect mode

Reflect mode generates mock interfaces by building a program
{'fraction_non_alphanumeric': 0.1037328094302554, 'fraction_numerical': 0.011787819253438114, 'mean_word_length': 4.382663847780127, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '550978', 'n_tokens_mistral': 833, 'n_tokens_neox': 770, 'n_words': 345}