Skip to content

Support for archive mode#258

Merged
sywhang merged 9 commits into
uber-go:mainfrom
JamyDev:archive
Jun 12, 2025
Merged

Support for archive mode#258
sywhang merged 9 commits into
uber-go:mainfrom
JamyDev:archive

Conversation

@JamyDev

@JamyDev JamyDev commented Jun 12, 2025

Copy link
Copy Markdown
Contributor

This adds support for a 3rd option for creating mocks after reflect and source-mode: the archive mode. Archive mode lets you load archive files to create mocks. This can come in handy for writing Bazel rules that produce intermediary archive files and automatically codegen mocks in Bazel environments.

Rebased version of #125

Comment thread README.md Outdated
Comment thread mockgen/mockgen.go Outdated
@CLAassistant

CLAassistant commented Jun 12, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sywhang sywhang merged commit 359202c into uber-go:main Jun 12, 2025
5 checks passed
sywhang pushed a commit that referenced this pull request Jun 12, 2025
Removes the broken reflect mode in the bazel aspect, in favor of archive
mode which was landed in #258

---------

Co-authored-by: Zhongpeng Lin <zplin@uber.com>
apricote pushed a commit to hetznercloud/fleeting-plugin-hetzner that referenced this pull request Aug 27, 2025
…eting-plugin-hetzner!269)

This MR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [go.uber.org/mock](https://github.com/uber/mock) | `v0.5.2` -> `v0.6.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/go.uber.org%2fmock/v0.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/go.uber.org%2fmock/v0.5.2/v0.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>uber/mock (go.uber.org/mock)</summary>

### [`v0.6.0`](https://github.com/uber-go/mock/releases/tag/v0.6.0)

[Compare Source](uber-go/mock@v0.5.2...v0.6.0)

#### 0.6.0 (18 Aug 2025)

##### Added

- [#&#8203;258][]: Archive mode: a new mockgen mode that generates mocks out of archive files.

##### Fixed

- [#&#8203;276][]: Fixed mockgen errors with go1.25 due to outdated golang.org/x/tools dependency.

[#&#8203;258]: uber-go/mock#258

[#&#8203;276]: uber-go/mock#276

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS43OC4wIiwidXBkYXRlZEluVmVyIjoiNDEuNzguMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
sywhang pushed a commit that referenced this pull request Oct 4, 2025
- Use the same code for `package` and `archive` modes (the `package`
parsing implementation)
- Delete `archive` parsing implementation added in #258
- ~~Bump `golang.org/x/tools` to v0.26.0 to support archives v2 and
unblock go1.25 support~~ (already landed #276)

Closes #272
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants