go-test

Runs Go unit tests with race detection and coverage.

4|Updated Sep 6, 2013
One-click install
npx skills add https://github.com/mway/dotfiles --skill go-test-mway
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-test
Source: https://github.com/mway/dotfiles/tree/main/home/dot_codex/skills/go-test
Command: npx skills add https://github.com/mway/dotfiles --skill go-test-mway

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running Go tests with race detection and coverage helps ensure code quality and catch data races early during development.

Core Features & Use Cases

  • Race-detected testing: Run tests with the -race flag to catch data races during development.
  • Coverage measurement: Generate a coverage profile to quantify test coverage across packages.
  • Deterministic CI-ready runs: Default to ./... and use -count 1 to avoid flaky caching; supports verbose output when needed.

Quick Start

Run go test with race detection and coverage across all packages.

Frequently Asked Questions about go-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Go tests with race detection and coverage?

Run Go tests with race detection and coverage by executing the Go toolchain with the -race flag and -coverprofile=cover.out flag. This validates race safety and generates a coverage profile across all packages.

Why does my Go test cache flaky results in CI pipelines?

Go test caching can cause flaky results in CI pipelines. Disable caching by using the -count 1 flag, which forces deterministic test execution and ensures consistent validation of package-level behavior.

What's the best way to check for data races during Go development?

Checking for data races during Go development is best done using the -race flag with the test command. This detects concurrent access to shared variables, helping catch race conditions early before code review.

Do I need the Go toolchain installed to measure test coverage?

Yes, you need the Go toolchain installed to measure test coverage. The toolchain provides the testing framework and flag support required to generate a coverage profile using -coverprofile=cover.out across packages.

Can I run verbose Go tests across all packages by default?

Yes, you can run verbose Go tests across all packages by default. The tool defaults to ./... for package scope and supports the -v flag for verbose output, providing detailed test execution logs for validation.