no-duplication

Eliminate duplicated test code in Go test files and manage testdata exclusions.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/Disble/dlexa --skill no-duplication
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: no-duplication
Source: https://github.com/Disble/dlexa/tree/main/.claude/skills/no-duplication
Command: npx skills add https://github.com/Disble/dlexa --skill no-duplication

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Eliminate duplicated test code in Go test files and manage testdata fixture exclusions to keep test suites maintainable and reliable.

Core Features & Use Cases

  • Pattern: Package-level shared vectors for test data to avoid replication across tests.
  • Pattern: Parameterized run loops to unify test execution.
  • Pattern: Fixture builders and testdata optimizations to reduce boilerplate.
  • Pattern: Cross-file helpers to centralize common test utilities.
  • Pattern: Golden-file / render assertion style tests to validate output deterministically.
  • Pattern: testdata exclusions in sonar-project.properties to ensure duplication analysis remains meaningful.

Quick Start

Identify duplicated test blocks in your Go test suite and apply the recommended refactors to reduce boilerplate and simplify maintenance.

Frequently Asked Questions about no-duplication

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

FAQPage Schema
How do I eliminate duplicated test code in Go test files?

To eliminate duplicated test code in Go test files, apply pattern-based refactoring using package-level shared vectors, parameterized run loops, and cross-file helpers to centralize test utilities and reduce boilerplate across multiple test files.

What is the best way to manage testdata fixture exclusions for SonarQube analysis?

Managing testdata fixture exclusions for SonarQube analysis involves configuring sonar-project.properties to exclude testdata fixtures. This ensures duplication analysis remains meaningful and ignores static test data files during code quality scans.

How do parameterized run loops reduce Go test boilerplate?

Parameterized run loops reduce Go test boilerplate by unifying test execution across multiple cases into a single loop. This pattern avoids replicating similar test blocks and standardizes execution across shared package-level vectors.

Can I use golden-file style tests to validate deterministic output in Go?

Yes, you can use golden-file style tests to validate deterministic output in Go. This pattern compares generated output against approved golden files, ensuring render assertions remain stable across multiple test files without duplicating expected values.

Do I need fixture builders to optimize testdata in Go tests?

You need fixture builders to optimize testdata in Go tests when reducing boilerplate across complex setups. They construct test data programmatically, replacing duplicated static fixtures with reusable builder utilities.

Why does SonarQube still report duplication on my Go testdata fixtures?

SonarQube reports duplication on Go testdata fixtures when they are not excluded properly. You must configure testdata exclusions within your sonar-project.properties file to prevent the scanner from analyzing static fixture data as regular source code.