Vai al contenuto
New

DeepSeek V4.1 Flash free for 7 days: 10M tokens a day after a top-up of $10 or more. Until Nov 30.

How it works
aeondave/golang-testingReverse engineering e fuzzing

golang-testing

⁨Go testing patterns for unit tests, table-driven tests, subtests, test helpers, mocking/fakes, benchmarks, fuzzing, and coverage. Use when writing or reviewing Go tests to improve correctness, stability, and maintainability.⁩

v2026.11.13-21cd5683 installazioni+3 in 7 giorni39 StelleMITsincronizzato 11 ore fa

Installa

Non hai ancora la CLI di NotHoly? Installala prima.

$ curl -fsSL https://notholy.com/install.sh | sh
$ notholy skills install aeondave/golang-testing

Scrive in ⁦~/.notholy/skills⁩ dopo aver controllato la firma e lo SHA-256.

FirmaFirmato, ed25519
gDiu8+JitJ…TRMFLWBA==La CLI controlla lo SHA-256 e la firma prima di scrivere qualsiasi file.
Pacchetto1c303df2…7a3ea5d6
1c303df21fe2…6d8b7a3ea5d69 file · ⁦8.4 KB⁩
ScansioneBasso1 segnalazione
  • Link a domini esterni
Vedi la scansione completa
Sorgentegithub.com/AeonDave/malskill/tree/main/coding/golang-testing@21cd568

Questa voce non è ancora scritta in italiano, quindi è mostrata in un'altra lingua: English.

This skill is about writing tests that are reliable, readable, and useful as documentation.

When to activate

  • Writing new tests for functions, packages, or APIs
  • Refactoring tests for clarity and reduced flakiness
  • Adding benchmarks or fuzz tests
  • Stabilizing concurrent or time-dependent tests (testing/synctest)
  • Improving coverage without gaming the metric

Core rules (high signal)

  • Prefer table-driven tests for coverage and readability.
  • Use t.Helper() and t.Cleanup() to keep failures actionable.
  • Tests should be deterministic: prefer testing/synctest over time.Sleep when the code under test uses time primitives.
  • Prefer fakes (in-memory implementations) over heavy mocks.
  • Use t.Parallel() only when the test is truly isolated.
  • Keep test data local and explicit; avoid hidden cross-test coupling.
  • Do not add exported production APIs solely for tests; prefer package seams, interfaces, or local fakes.
  • Pair with test-driven-development when implementing persistent code or bug fixes test-first.
  • Pair with testing-reliability for mock/timing anti-patterns and systematic-debugging when failure attribution is unclear.

Outcome expectations

  • Unit tests are fast, deterministic, and easy to debug.
  • Flaky tests are triaged with a repeatable reproduction loop.
  • Bench/fuzz/coverage are used as correctness signals, not vanity metrics.

  1. Write/adjust focused unit tests first (table + subtests).
  2. Run targeted test selection to confirm behavior quickly.
  3. Add race detector and coverage checks.
  4. For instability, reproduce with repeated runs (-count) and isolate state/time dependencies (synctest for time-based concurrency).
  5. Add benchmarks/fuzz tests when behavior or performance risk justifies them.

Quick checklist for a review

  • Setup is outside the assertion loop; minimal shared mutable state
  • Subtests have meaningful names (t.Run("case", ...))
  • Error messages show got/want and context
  • External dependencies are explicit (DBs, network, time)
  • Benchmarks report allocs when relevant (b.ReportAllocs())

Resources

Load on demand:

  • references/unit-tests.md — TDD loop, table tests, subtests, parallel subtests
  • references/helpers-fixtures.md — helpers, TempDir, Cleanup, testdata, golden files
  • references/mocking-fakes.md — interfaces for dependencies, fakes vs mocks, examples
  • references/http-testing.md — httptest patterns, NewTestServer (Go 1.27+), JSON assertions
  • references/bench-fuzz.md — benchmarks and fuzzing best practices
  • references/fuzzing-and-race.md — load for go test -fuzz campaigns, race detector, goleak, goroutineleak profiles, and testing/synctest (Test/Wait/Sleep)
  • references/coverage-ci.md — cover profiles, coverpkg notes, CI integration cautions
  • references/commands.md — go test command recipes (race, timeout, count, patterns)

File di questa versione

Permessi

PermessoDichiaratoTrovato dalla scansione
Legge fileNoNo
Scrive fileNoNo
Esegue comandi shellSìSì
Usa la reteSìSì
Usa i connettoriNoNo
Controlla un browserNoNo

Segnalazioni della scansione

Rivisto il 13 nov 2026

  1. InfoLink · Link a domini esterni

Una scansione pulita abbassa il rischio, ma non prova che il pacchetto sia sicuro. Leggi quello che installi.

VersionePubblicataCommitSHA-256FirmaCambio di permessi
v2026.11.13-21cd56813 nov 202621cd5681c303df2Firmata–

Chiedi tutto quello che il tuo perimetro consente.

Crea un account, aggiungi crediti e fai la prima domanda in chat o nel terminale.

  1. 1/3

    Crea l'account

    Privato o azienda. Puoi passare ad azienda in seguito senza perdere saldo o chiavi.

    PrivatoAzienda
  2. 2/3

    Aggiungi crediti

    Con carta. Paghi a token, senza abbonamento.

    $5.00ricarica minima
  3. 3/3

    Chiedi

    In chat, oppure installa la CLI ed esegui notholy login nel terminale.

    $ notholy login