go

Run Go tests with gotestsum and configure output formats.

40|12|Updated Oct 17, 2011
One-click install
npx skills add https://github.com/lanej/dotfiles --skill go-lanej
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go
Source: https://github.com/lanej/dotfiles/tree/main/claude/skills/go
Command: npx skills add https://github.com/lanej/dotfiles --skill go-lanej

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidance for Go development workflows, testing, and tooling to streamline Go projects and reduce debugging time.

Core Features & Use Cases

  • Testing workflow: Strongly preferred: Use gotestsum for all test execution to get colored, structured output and reliable results.
  • Standard Go tooling: Guidance on using go fmt, go vet, go build, go test, and common linters to maintain quality.
  • Development workflow: Best practices for module management, code formatting, vetting, and efficient Go project maintenance.

Quick Start

Use the Go Skill to run tests with gotestsum across all packages:

  • Basic test run: gotestsum ./...
  • Verbose test run: gotestsum -v ./...
  • Run tests in a specific package: gotestsum ./pkg/mypackage/...

Frequently Asked Questions about go

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

FAQPage Schema
How do I run Go tests with reliable output and colored formatting?

Use gotestsum for all test execution to get colored, structured output and consistent results. Run `gotestsum ./...` for basic test execution across all packages, or `gotestsum -v ./...` for verbose output.

What's the best way to set up a Go testing workflow for TDD?

Configure gotestsum with watch mode and race detection to catch concurrency issues early. Combine with standard `go fmt`, `go vet`, and linters to maintain code quality while iterating tests rapidly.

Can I use gotestsum with specific Go packages instead of all packages?

Yes, gotestsum supports targeting specific packages. Run `gotestsum ./pkg/mypackage/...` to execute tests in a particular package while maintaining structured output and reliability.

Does gotestsum work with Go coverage and race detection?

Gotestsum integrates with Go's built-in coverage and race detection flags. Configure these options through gotestsum to detect data races and measure test coverage within your standard development and CI workflows.

Why should I use gotestsum instead of running go test directly?

Gotestsum solves unreliable test execution and inconsistent output by providing colored, structured formatting and deterministic results. It applies to Go projects of all sizes and integrates seamlessly with CI and code quality processes.

What Go tooling should I combine with gotestsum for a complete workflow?

Pair gotestsum with `go fmt` for formatting, `go vet` for static analysis, `go build` for compilation, and standard linters. This maintains code quality and reduces debugging time across development, CI, and deployment stages.