Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Separate Readme sections for Source mode, Reflect mode and Flags #495

Merged
merged 3 commits into from
Oct 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Running mockgen
---------------

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

#### Source mode
dstivanov marked this conversation as resolved.
Show resolved Hide resolved
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.
Expand All @@ -46,6 +48,7 @@ Example:
mockgen -source=foo.go [other options]
```

#### Reflect mode
Reflect mode generates mock interfaces by building a program
that uses reflection to understand interfaces. It is enabled
by passing two non-flag arguments: an import path, and a
Expand All @@ -62,6 +65,7 @@ mockgen database/sql/driver Conn,Driver
mockgen . Conn,Driver
```

#### Flags
dstivanov marked this conversation as resolved.
Show resolved Hide resolved
The `mockgen` command is used to generate source code for a mock
class given a Go source file containing interfaces to be mocked.
It supports the following flags:
Expand Down