Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sanposhiho authored Jul 12, 2021
1 parent f9c2684 commit 1c06f5b
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,8 @@ These are the options for using the gomockhandler.
The default value is false.
```

## generate mock

You can generate all mocks from config.

```
gomockhandler -config=/path/to/gomockhandler.json mockgen
```

## check if mock is up-to-date

You can check if the mock is generated based on the latest interface.

It is useful for ci.

```
gomockhandler -config=/path/to/gomockhandler.json check
```
If some mocks are not up to date, you can see the error and `gomockhandler` will exit with exit-code 1

```
2021/03/10 22:17:12 [WARN] mock is not up to date. source: ./interfaces/user.go, destination: ./interfaces/../mock/user.go
2021/03/10 22:17:12 mocks is not up-to-date
```

## configuring
## Getting started

You need a config for `gomockhandler`.

Expand Down Expand Up @@ -172,6 +149,31 @@ You can remove the mocks to be generated from the config.
gomockhandler -config=/path/to/gomockhandler.json -destination=./mock/user.go deletemock
```


## generate mock

You can generate all mocks from config.

```
gomockhandler -config=/path/to/gomockhandler.json mockgen
```

## check if mock is up-to-date

You can check if the mock is generated based on the latest interface.

It is useful for ci.

```
gomockhandler -config=/path/to/gomockhandler.json check
```
If some mocks are not up to date, you can see the error and `gomockhandler` will exit with exit-code 1

```
2021/03/10 22:17:12 [WARN] mock is not up to date. source: ./interfaces/user.go, destination: ./interfaces/../mock/user.go
2021/03/10 22:17:12 mocks is not up-to-date
```

## edit config manually

You can edit the config manually.
Expand Down

0 comments on commit 1c06f5b

Please sign in to comment.