Toolverse
All skills

go-table-driven-tests

by Xe

Write Go table-driven tests following Go community best practices and this repository's conventions. Use when writing or refactoring Go tests, especially when you notice repeated test patterns or copy-pasted test code.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
Xe
Category
Testing
Views
3

About this skill

Write Go table-driven tests following Go community best practices and this repository's conventions. Use when writing or refactoring Go tests, especially when you notice repeated test patterns or copy-pasted test code.

How to use

  1. Zainstaluj skill w swoim Claude/Codex/Copilot poprzez dodanie go-table-driven-tests do konfiguracji narzędzia (szczegóły instalacji znajdziesz w dokumentacji Twojego agenta AI).

  2. Otwórz plik Go z testami, w których widzisz powtarzające się funkcje testowe lub skopiowany kod – skill działa najlepiej gdy masz już kilka podobnych przypadków testowych.

  3. Zaznacz kod testowy lub wskaż funkcję do refaktoryzacji i poproś skill o przepisanie jej w stylu table-driven. Skill automatycznie zasugeruje strukturę z polami name, input, want i err.

  4. Przejrzyj wygenerowany szablon – zawiera on pętlę for z t.Run() dla każdego przypadku, co umożliwia uruchamianie testów oddzielnie. Dostosuj nazwy pól struktury do Twoich potrzeb (np. jeśli testujesz funkcję zwracającą wiele wartości, dodaj dodatkowe pola want).

  5. Dodaj nowe przypadki testowe do slajsu cases bez pisania nowych funkcji testowych – wystarczy dołożyć kolejny element struktury z innymi danymi wejściowymi i oczekiwanymi wynikami.

  6. Uruchom testy poleceniem go test i sprawdź, czy wszystkie przypadki przechodzą. Skill wspiera zarówno proste testy wartości jak i scenariusze z obsługą błędów – wybierz wzorzec odpowiedni dla Twojej funkcji.

Related skills

backtesting-frameworks

by wshobson

Build robust backtesting systems for trading strategies with proper handling of look-ahead bias, survivorship bias, and transaction costs. Use when developing trading algorithms, validating strategies, or building backtesting infrastructure.

Testing
12105

textual

by KyleKing

Expert guidance for building TUI (Text User Interface) applications with the Textual framework. Invoke when user asks about Textual development, TUI apps, widgets, screens, CSS styling, reactive programming, or testing Textual applications.

Testing
69192

testing-workflow

by amo-tech-ai

Comprehensive testing workflow for E2E, integration, and unit tests. Use when testing applications layer-by-layer, validating user journeys, or running test suites.

Testing
1076

hono

by openstatusHQ

Efficiently develop Hono applications using Hono CLI. Supports documentation search, API reference lookup, request testing, and bundle optimization.

Testing
1257

dependency-upgrade

by wshobson

Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.

Testing
17138

differential-review

by trailofbits

Performs security-focused differential review of code changes (PRs, commits, diffs). Adapts analysis depth to codebase size, uses git history for context, calculates blast radius, checks test coverage, and generates comprehensive markdown reports. Automatically detects and

Testing
2510