1---2name: li-lance-android-seraphim-framework-golang-testing3description: Golang Testing4---56# Golang Testing78## **Priority: P0 (CRITICAL)**910## Implementation Workflow11121. **Write failing test first** — Follow Red-Green-Refactor TDD workflow.132. **Use table-driven tests** — Define test cases as a slice of structs; iterate with `t.Run()`.143. **Mock via interfaces** — Use DI and interfaces. Prefer `mockery` for auto-generated mocks or15 manual mocks for simple cases.164. **Run parallel** — Use `t.Parallel()` for non-sequential tests to speed up CI.175. **Clean up resources** — Use `t.Cleanup()` to reset state or release DB/file resources.186. **Check coverage** — Aim for >80% line coverage. Run `go test -cover` to audit.1920See [table-driven test examples](references/table-driven-tests.md)2122## Tools2324- **Stdlib**: `testing` package is usually enough.25- **Testify**: Assertions (`assert`, `require`) and mocks.26- **Mockery**: Auto-generate mocks for interfaces.27- **GoMock**: Popular mocking framework alternative.2829## Naming3031- Test file: `*_test.go`32- Test function: `func TestName(t *testing.T)`33- Example function: `func ExampleName()`3435## Anti-Patterns3637- **No assert in loops**: Use `t.Run` subtests to isolate failures.38- **No global mock state**: Define mocks locally within test scope.39- **No skipping race detection**: Always run `go test -race` in CI.4041## References4243- [Table-Driven Tests](references/table-driven-tests.md)44- [Mocking Strategies](references/mocking-strategies.md)4546---47> Source: [li-lance/android-seraphim-framework](https://github.com/li-lance/android-seraphim-framework) — distributed by [TomeVault](https://tomevault.io).48<!-- tomevault:4.0:skill_md:2026-06-16 -->
Run npx skillmds@latest add tomevault-io/li-lance-android-seraphim-framework-golang-testing in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Golang Testing It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.