# 使用 Homebrew 安装 counterfeiter

查看 counterfeiter 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:counterfeiter
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install counterfeiter
```

  证据: local Homebrew formula metadata

## 软件包事实

- **软件包键:** brew:counterfeiter
- **软件包管理器:** Homebrew
- **版本:** 6.12.2
- **来源摘要:** Tool for generating self-contained, type-safe test doubles in go
- **主页:** <https://github.com/maxbrunsfeld/counterfeiter>
- **仓库:** <https://github.com/maxbrunsfeld/counterfeiter>
- **最后更新:** 2026-07-25T14:20:51-04:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- counterfeiter (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 6.12.2
## 项目历史与用法

counterfeiter is a Go code generator for creating self-contained, type-safe test doubles from interfaces.

### 项目历史

The public repository was created in 2014. Its README frames the project around a Go-specific testing problem: fake implementations are useful for unit tests but cannot be generated automatically at runtime in Go.

The project has continued through a v6 release line, with current documentation using Go modules and Go tool dependencies.

### 采用历史

counterfeiter's documented workflow follows Go ecosystem conventions: add it as a tool dependency, place `go:generate` or `counterfeiter:generate` directives near interfaces, and regenerate fakes with `go generate`.

The README notes that the project has largely been maintained by the community, which fits its role as a small but durable testing utility rather than a framework-owned generator.

### 使用方式

Typical use is to generate fakes for interfaces in the same module or for third-party interfaces, then import the generated `foofakes` package in tests to inspect call counts, arguments, and stubbed return values.

### 为什么软件包爱好者会关心

For package maintainers, counterfeiter is a good example of a Go CLI whose preferred installation changed with Go tooling: Homebrew can ship a binary, but the upstream docs now prefer module-pinned tool dependencies for reproducible generation.

### 时间线

- 2014: Public GitHub repository created.
- 2024: v6.8.x through v6.11.x releases published.
- 2026: v6.12.2 release published.

### Related projects

- go generate
- Go modules
- Go tool dependencies

### 来源

- <https://github.com/maxbrunsfeld/counterfeiter>
- <https://api.github.com/repos/maxbrunsfeld/counterfeiter>
- <https://github.com/maxbrunsfeld/counterfeiter/releases>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Combined YAML source

View the package source record on GitHub. [combined/counterfeiter.yml](https://github.com/mxcl/pkgdb/blob/main/combined/counterfeiter.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- cross-ecosystem install command graph
