testcontainers/testcontainers-go

GitHub: testcontainers/testcontainers-go

一个 Go 语言测试库,通过 Docker 容器为集成测试和冒烟测试动态创建真实的依赖环境,并在测试结束后自动清理。

Stars: 4766 | Forks: 602

# Testcontainers [![主流水水线](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/b2bdbc8dd4231418.svg)](https://github.com/testcontainers/testcontainers-go/actions/workflows/ci.yml) [![GoDoc 参考](https://pkg.go.dev/badge/github.com/testcontainers/testcontainers-go.svg)](https://pkg.go.dev/github.com/testcontainers/testcontainers-go) [![Go 报告卡](https://goreportcard.com/badge/github.com/testcontainers/testcontainers-go)](https://goreportcard.com/report/github.com/testcontainers/testcontainers-go) [![质量门状态](https://sonarcloud.io/api/project_badges/measure?project=testcontainers_testcontainers-go&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=testcontainers_testcontainers-go) [![许可证](https://img.shields.io/badge/license-MIT-blue)](https://github.com/testcontainers/testcontainers-go/blob/main/LICENSE) [![在 GitHub Codespaces 中打开](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/db8b3942d3231420.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=141451032&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=EastUs) [![加入我们的 Slack](https://img.shields.io/badge/Slack-4A154B?logo=slack)](https://testcontainers.slack.com/) _Testcontainers for Go_ 是一个 Go 包,它使得为自动化集成/冒烟测试创建和清理基于容器的依赖项变得简单。干净且易于使用的 API 使开发人员能够以编程方式定义应作为测试一部分运行的容器,并在测试完成后清理这些资源。 您可以在 [golang.testcontainers.org](https://golang.testcontainers.org) 找到有关 _Testcontainers for Go_ 的更多信息,该网站是由 [./docs](./docs) 目录渲染而成的。 ## 使用 _Testcontainers for Go_ 请访问 [快速入门指南](https://golang.testcontainers.org/quickstart) 以了解如何将依赖项添加到您的 Go 项目中。
标签:API, Docker, EVTX分析, Go, Golang, Ruby工具, Testcontainers, 临时容器, 依赖管理, 单元测试, 安全编程, 安全防御评估, 容器化测试, 容器管理, 开发库, 开源框架, 持续集成, 日志审计, 测试依赖, 测试工具, 测试框架, 烟雾测试, 端到端测试, 编程库, 请求拦截, 集成测试