Skip to content

Releases: uber-go/mock

v0.6.0

18 Aug 15:01
2d1c581

Choose a tag to compare

0.6.0 (18 Aug 2025)

Added

  • #258: Archive mode: a new mockgen mode that generates mocks out of archive files.

Fixed

  • #276: Fixed mockgen errors with go1.25 due to outdated golang.org/x/tools dependency.

bazel_rule_v0.2.0

13 Jun 18:23
aa11bfc

Choose a tag to compare

bazel_rule_v0.2.0 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: bazel_rule_v0.1.0...bazel_rule_v0.2.0

Bazel rule v0.1.0

12 Jun 21:57
bb4128e

Choose a tag to compare

This is the first release of the Bazel rule copied from rules_go with minor changes:

#231

This release works with go.uber.org/mock up to v0.4.0

v0.5.2

28 Apr 16:22
0b8095f

Choose a tag to compare

0.5.2 (28 Apr 2025)

Fixed

  • #248: Fixed an issue with type aliases not being included in generated code correctly.

v0.5.1

07 Apr 19:19
cf6f33d

Choose a tag to compare

0.5.1 (7 Apr 2025)

Fixed

  • #220: Package mode will now generate code that uses aliases of types
    when they are used in the source.
  • #219: Fixed a collision between function argument names and package names
    in generated code.
  • #165: Fixed an issue where aliases specified by -imports were not being
    respected in generated code.

Thanks to @mtoader and @bstncartwright for their contributions to this release.

v0.5.0

17 Oct 21:39
a9c44d9

Choose a tag to compare

0.5.0 (15 Oct 2024)

Added

  • #153: Add --write_command_comment flag to specify whether to include
    Generated by this command comment.
  • #191: Add --build_constraint flag to add //go:build directives
    to generated mocks
  • #214: Add gob mode to support custom package loading techniques in place
    of --exec_only

Changed

  • #181: Made mockgen faster by changing flags passed to go list.
  • #183: Made Cond matcher generic.
  • #204: Removed ISGOMOCK() from generated mocks.
  • #207: Deprecated reflect mode and replaced it with the new package mode.

Fixed

  • #144: Fix a deadlock that can happen when mocking an interface that
    matches fmt.Stringer.
  • #168: Fix an issue where the "generated by" comment was being included
    in the package comment of generated mocks.

Thanks to @tulzke @JacobOaks @ARR4N @sashamelentyev @sywhang @fasmat
@eyasy1217 @ghouscht @tie @Neo2308 @carson-brill @alexandear @sodul
@nbgraham for their contributions this release.

v0.4.0

20 Dec 22:50
74a29c6

Choose a tag to compare

0.4.0 (20 Dec 2023)

Added

  • #63: AnyOf matcher for values that satisfy at least one matcher.
  • #114: Regex matcher.

Fixed

  • #93: Ignore interfaces that contain type constraints.
  • #101: Fix race condition on Controller.Satisfied.
  • #121: Fix paths for windows.
  • #127: Propogate -mock_names to Recorder and ReturnCall types.
  • #132: Sanitize "any" package names.

Thanks to @favonia @hoonmin @pshopper @davidharrigan @dlsniper @merrett010
@craig65535 @chemidy @tulzke @UnAfraid @JacobOaks @sywhang for their
contributions this release.

v0.3.0

16 Sep 05:38
57226e5

Choose a tag to compare

Added

  • #13: Support for embedded generic interfaces.
  • #33: -write_source_comment for writing the original file or interface names
    in the generated code.
  • #46: -write-generate-directive for generating go:generate directives into
    the generated mock.
  • #60: Cond matcher for specifying a conditional matcher as the result of a
    given function.
  • #72: exclude_interfaces flag for specifying list of interfaces to exclude
    from mock generation.

Fixed

  • #41: A bug with specifying local import name with -imports flag.
  • #52: A panic that occurs in gob.Register when used in conjunction with
    golang/mock.
  • #78: InOrder can be used with type-safe mocks generated with -typed flag.

Thanks to @alexandear, @bcho, @deathiop, @sivchari, @k3forx, @n0trace,
@utgwkk, @ErfanMomeniii, @bcho, @damianopetrungaro, @tulzke,
and @EstebanOlmedo for their contributions to this release.

v0.2.0

06 Jul 17:25
bb5901f

Choose a tag to compare

Added

  • Controller.Satisfied that lets you check whether all expected calls
    bound to a Controller have been satisfied.
  • NewController now takes optional ControllerOption parameter.
  • WithOverridableExpectations is a ControllerOption that configures
    Controller to override existing expectations upon a new EXPECT().
  • -typed flag for generating type-safe methods in the generated mock.

v0.1.0

29 Jun 15:59
c1ed26f

Choose a tag to compare

0.1.0 (29 Jun 2023)

This is a minor version that mirrors the original golang/mock
project that this project originates from.

Any users on golang/mock project should be able to migrate to
this project as-is, and expect exact same set of features (apart
from supported Go versions. See README
for more details.