testing

Golang Testing Standards

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "testing" with this command: npx skills add mte90/dotfiles/mte90-dotfiles-testing

Golang Testing Standards

Priority: P0 (CRITICAL)

Principles

Guidelines

TDD Workflow

  • Red: Write a failing table-driven test case.

  • Green: Implement logic to pass.

  • Refactor: Simplify code.

Golden Snippet

See Table-Driven Tests for full template.

Tools

  • Stdlib: testing package is usually enough.

  • Testify (stretchr/testify ): Assertions (assert , require ) and Mocks.

  • Mockery: Auto-generate mocks for interfaces.

  • GoMock: Another popular mocking framework.

Naming

  • Test file: *_test.go

  • Test function: func TestName(t *testing.T)

  • Example function: func ExampleName()

Anti-Patterns

  • Sleeping in tests: Use channels/waitgroups or retry logic.

  • Testing implementation details: Test public behavior/interface.

References

  • Table-Driven Tests

  • Mocking Strategies

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

testing

No summary provided by upstream source.

Repository SourceNeeds Review
General

architecture

No summary provided by upstream source.

Repository SourceNeeds Review
General

dotnet-10-csharp-14

No summary provided by upstream source.

Repository SourceNeeds Review
General

testing

No summary provided by upstream source.

Repository SourceNeeds Review