Skip to content

Commit

Permalink
Update README (#8)
Browse files Browse the repository at this point in the history
Update README to reflect:
- current status
- installation path
- supported Go versions
- Remove irrelevant info
  • Loading branch information
sywhang committed Jun 27, 2023
1 parent b6bd955 commit ce92d72
Showing 1 changed file with 10 additions and 46 deletions.
56 changes: 10 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit ce92d72

Please sign in to comment.