-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README to reflect: - current status - installation path - supported Go versions - Remove irrelevant info
- Loading branch information
Showing
1 changed file
with
10 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,30 +12,15 @@ within Uber, we've decided to fork and maintain this going forward at Uber. | |
|
||
Contributions are welcome in the form of GitHub issue or PR! | ||
|
||
## Installation | ||
## Status | ||
|
||
Once you have [installed Go][golang-install], install the `mockgen` tool. | ||
This project is still WIP. We will be tagging a release shortly, in early July. | ||
|
||
**Note**: If you have not done so already be sure to add `$GOPATH/bin` to your | ||
`PATH`. | ||
## Supported Go Versions | ||
|
||
To get the latest released version use: | ||
|
||
### Go version < 1.16 | ||
|
||
```bash | ||
GO111MODULE=on go get github.com/golang/mock/[email protected] | ||
``` | ||
|
||
### Go 1.16+ | ||
|
||
```bash | ||
go install github.com/golang/mock/[email protected] | ||
``` | ||
|
||
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. | ||
go.uber.org/mock supports all Go versions supported by the official | ||
[Go Release Policy](https://go.dev/doc/devel/release#policy). That is, | ||
the two most recent releases of Go. | ||
|
||
## Running mockgen | ||
|
||
|
@@ -256,28 +241,7 @@ If the received value is `3`, then it will be printed as `03`. | |
[golang]: http://golang.org/ | ||
[golang-install]: http://golang.org/doc/install.html#releases | ||
[gomock-reference]: https://pkg.go.dev/github.com/golang/mock/gomock | ||
[ci-badge]: https://github.com/golang/mock/actions/workflows/test.yaml/badge.svg | ||
[ci-runs]: https://github.com/golang/mock/actions | ||
[reference-badge]: https://pkg.go.dev/badge/github.com/golang/mock.svg | ||
[reference]: https://pkg.go.dev/github.com/golang/mock | ||
## Debugging Errors | ||
### reflect vendoring error | ||
```text | ||
cannot find package "." | ||
... github.com/golang/mock/mockgen/model | ||
``` | ||
If you come across this error while using reflect mode and vendoring | ||
dependencies there are three workarounds you can choose from: | ||
1. Use source mode. | ||
2. Include an empty import `import _ "github.com/golang/mock/mockgen/model"`. | ||
3. Add `--build_flags=--mod=mod` to your mockgen command. | ||
This error is due to changes in default behavior of the `go` command in more | ||
recent versions. More details can be found in | ||
[#494](https://github.com/golang/mock/issues/494). | ||
[ci-badge]: https://github.com/uber/mock/actions/workflows/test.yaml/badge.svg | ||
[ci-runs]: https://github.com/uber/mock/actions | ||
[reference-badge]: https://pkg.go.dev/badge/github.com/uber/mock.svg | ||
[reference]: https://pkg.go.dev/github.com/uber/mock |