From 784bfef9b56f1aa24e75a0a8d28f426c773122eb Mon Sep 17 00:00:00 2001 From: Dimitar Ivanov Date: Fri, 23 Oct 2020 13:24:25 +0300 Subject: [PATCH 1/3] Separate Readme sections for Source mode, Reflect mode and Flags --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 40d9f451..8fec3a3e 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ 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. @@ -46,6 +47,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 @@ -61,7 +63,7 @@ mockgen database/sql/driver Conn,Driver # Convenient for `go:generate`. mockgen . Conn,Driver ``` - +#### Flags 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: From 18831ce1bad4aeea37bef639b0cfa3cd457edd73 Mon Sep 17 00:00:00 2001 From: Dimitar Ivanov Date: Mon, 26 Oct 2020 08:51:31 +0200 Subject: [PATCH 2/3] Update README.md Co-authored-by: Cody Oss <6331106+codyoss@users.noreply.github.com> --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8fec3a3e..b03910b5 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ 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 From 040fb5e9c1d2d49065a731e5fafb12c88b028deb Mon Sep 17 00:00:00 2001 From: Dimitar Ivanov Date: Mon, 26 Oct 2020 08:51:38 +0200 Subject: [PATCH 3/3] Update README.md Co-authored-by: Cody Oss <6331106+codyoss@users.noreply.github.com> --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b03910b5..77b97017 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ mockgen database/sql/driver Conn,Driver # Convenient for `go:generate`. mockgen . Conn,Driver ``` + #### Flags The `mockgen` command is used to generate source code for a mock class given a Go source file containing interfaces to be mocked.