diff --git a/CLAUDE.md b/CLAUDE.md index d734c31..ff0adda 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -486,7 +486,7 @@ Store your evaluation scenarios in `skills/{name}/evals/evals.json`. - **Avoid leading prompts.** Don't mention the correct approach in the task description (e.g. don't say "use container/list" — say "implement LRU cache"). Don't hint at the answer. Don't name the rule, alert type, or problem category — if the prompt labels the issue, the model can reason to the fix without the skill. - **Stress-test edge cases.** The skill's common-mistakes tables and "when NOT to use" guidance are high-value targets. - **Pre-flight every candidate eval without the skill.** If the model passes, cut it or redesign it before adding it to the suite. This is the cheapest quality gate. -- **Prefer positive trigger tests over negative ones.** Testing "don't do X when not applicable" is weak — models have a strong prior of not acting when uncertain. Every eval should test the model *doing* something correctly, not refraining. +- **Prefer positive trigger tests over negative ones.** Testing "don't do X when not applicable" is weak — models have a strong prior of not acting when uncertain. Every eval should test the model _doing_ something correctly, not refraining. - **Target rules that are saturated in training data last.** Widely-documented patterns, standard stdlib idioms, and common Go conventions appear in countless guides and produce little or no delta. Focus first on rules that are counterintuitive, library-specific, or unique to the skill's domain. - **Don't let prompt context substitute for skill knowledge.** If the eval describes the problem with enough specificity that the model can reason to the correct answer, the skill becomes redundant. Present the problem as an opaque or misleading scenario where the skill's rule resolves an ambiguity the model would otherwise get wrong. - **Keep assertions within a group homogeneous.** Mixing common-knowledge assertions with skill-specific ones in the same eval group produces a partial score that masks both problems — some assertions pass in both conditions (common knowledge), others fail in both (coverage gap). Each eval group should test a single, skill-specific behavior. @@ -551,8 +551,7 @@ Before starting any task, propose a branch name and ask the developer to confirm After making changes, suggest the following as next steps for the developer to run. Do NOT execute these automatically. 1. ~~Validate against the spec: `skills-ref validate ./skills/{name}`~~ (disabled — [skills-ref doesn't support `user-invocable` yet](https://github.com/agentskills/agentskills/issues/105)) -2. Reformat markdowns with `npx prettier --write *.md "**/*.md"` then lint with `markdownlint-cli2 --config .markdownlint-cli2.jsonc ./` — run before measuring tokens, as formatting changes token counts -2b. Run `SNYK_TOKEN= uvx snyk-agent-scan@latest skills//` and fix any W011/W012/W001 warnings before proceeding (see [Snyk agent scanner compliance](#snyk-agent-scanner-compliance)) +2. Reformat markdowns with `npx prettier --write *.md "**/*.md"` then lint with `markdownlint-cli2 --config .markdownlint-cli2.jsonc ./` — run before measuring tokens, as formatting changes token counts 2b. Run `SNYK_TOKEN= uvx snyk-agent-scan@latest skills//` and fix any W011/W012/W001 warnings before proceeding (see [Snyk agent scanner compliance](#snyk-agent-scanner-compliance)) 3. Measure token counts: - **Description (tok)**: `awk 'NR==1 && /^---$/{found=1; next} found && /^---$/{exit} found && /^description:/{print}' skills/{name}/SKILL.md | tiktoken-cli` - **SKILL.md (tok)**: `tiktoken-cli skills/{name}/SKILL.md` diff --git a/GOLANG-AI-DRIVEN-REVIEW.md b/GOLANG-AI-DRIVEN-REVIEW.md index d562847..d6abfe2 100644 --- a/GOLANG-AI-DRIVEN-REVIEW.md +++ b/GOLANG-AI-DRIVEN-REVIEW.md @@ -14,7 +14,7 @@ Add AI agents as PR reviewers alongside traditional static analysis. When config Run `/install-github-app` in Claude Code to install the GitHub app and connect to the Claude API. Then create `.github/workflows/ai-code-review.yml`: -```yaml +````yaml name: AI Code Review (Claude) on: @@ -75,6 +75,7 @@ jobs: actions: read claude_args: >- --allowedTools "mcp__github_inline_comment__create_inline_comment,mcp__context7__resolve-library-id,mcp__context7__query-docs,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" + prompt: | REPO: ${{ github.repository }} PR NUMBER: ${{ github.event.pull_request.number }} @@ -152,6 +153,7 @@ jobs: actions: read claude_args: >- --allowedTools "mcp__github_inline_comment__create_inline_comment,mcp__context7__resolve-library-id,mcp__context7__query-docs,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" + prompt: | REPO: ${{ github.repository }} PR NUMBER: ${{ github.event.pull_request.number }} @@ -230,6 +232,7 @@ jobs: actions: read claude_args: >- --allowedTools "mcp__github_inline_comment__create_inline_comment,mcp__context7__resolve-library-id,mcp__context7__query-docs,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" + prompt: | REPO: ${{ github.repository }} PR NUMBER: ${{ github.event.pull_request.number }} @@ -307,6 +310,7 @@ jobs: actions: read claude_args: >- --allowedTools "mcp__github_inline_comment__create_inline_comment,mcp__context7__resolve-library-id,mcp__context7__query-docs,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" + prompt: | REPO: ${{ github.repository }} PR NUMBER: ${{ github.event.pull_request.number }} @@ -382,6 +386,7 @@ jobs: actions: read claude_args: >- --allowedTools "Bash(gh pr comment:*),Bash(gh pr view:*),Bash(gh run view:*),Bash(gh run list:*)" + prompt: | REPO: ${{ github.repository }} PR NUMBER: ${{ github.event.pull_request.number }} @@ -419,6 +424,7 @@ jobs: track_progress: false claude_args: >- --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr view:*),Bash(gh pr diff:*)" + prompt: | REPO: ${{ github.repository }} PR NUMBER: ${{ github.event.pull_request.number }} @@ -447,7 +453,7 @@ jobs: Use `mcp__github_inline_comment__create_inline_comment` to reply inline when the comment is line-specific, otherwise use `gh pr comment`. Post nothing else. No chat output. -``` +```` Remove jobs you don't need to reduce cost. The `ci-diagnosis` and `discuss` jobs add no review API cost — they only run when other jobs fail or a human comments. @@ -502,8 +508,7 @@ Pick skills that look relevant. Even if they have a 0.001% chance of applying. R - 🟠 **IMPORTANT** — significant quality or maintainability concern; strongly recommended. - 🟡 **SUGGESTION** — style, naming, or minor improvement; optional but worthwhile. -Write short, concise comments. Reference the exact file and line. Explain what is wrong and why it -matters. Provide a concrete fix. Post nothing if there is nothing to say. +Write short, concise comments. Reference the exact file and line. Explain what is wrong and why it matters. Provide a concrete fix. Post nothing if there is nothing to say. ``` --- diff --git a/README.md b/README.md index 480ed52..dc4470f 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ AI agent skills are reusable instruction sets that extend your coding assistant For generic skills, please visit [cc-skills](https://github.com/samber/cc-skills). -> [!IMPORTANT] -> Bootstrapped with Claude Code by distilling my Go project commits. **Edited, tested, reviewed and reworked by a human**. +> [!IMPORTANT] Bootstrapped with Claude Code by distilling my Go project commits. **Edited, tested, reviewed and reworked by a human**. > > **No AI slop here.** AI-made skills are useless. @@ -205,7 +204,7 @@ These skills are designed as **atomic, cross-referencing units**. A skill may re See [EVALUATIONS.md](./EVALUATIONS.md) for the full per-skill breakdown. -## 🕵 Use in CI for AI-driven reviews +## 🕵 Use in CI for AI-driven reviews Add AI agents as PR reviewers alongside traditional static analysis. When configured with this skill plugin, the agent applies the relevant Go skills per review area — catching architectural drift, logic bugs, and concurrency hazards that linters cannot detect. diff --git a/skills/golang-benchmark/SKILL.md b/skills/golang-benchmark/SKILL.md index d126333..adfc1ce 100644 --- a/skills/golang-benchmark/SKILL.md +++ b/skills/golang-benchmark/SKILL.md @@ -125,6 +125,7 @@ Parse-32 12.00 ± 0% 6.000 ± 0% -50.00% (p=0.000 n=10) ``` **Rules:** + - Only include benchmarks directly affected by the change — strip unrelated rows - Never paste results with `~` (no statistical significance) — the improvement cannot be claimed - Include the hardware context line (`goos/goarch/cpu`) so results are reproducible @@ -156,7 +157,7 @@ For full pprof CLI reference (all commands, non-interactive mode, profile interp - **[benchstat Reference](./references/benchstat.md)** — Statistical comparison of benchmark runs with rigorous confidence intervals and p-value tests. Covers output reading, filtering old benchmarks, interleaving results for visual clarity, and regression detection. Use this when you need to prove a change made a meaningful performance difference, not just a lucky run. -- **[Trace Reference](./references/trace.md)** — Execution tracer for understanding *when* and *why* code runs. Visualizes goroutine scheduling, garbage collection phases, network blocking, and custom span annotations. Use this when pprof (which shows *where* CPU goes) isn't enough — you need to see the timeline of what happened. +- **[Trace Reference](./references/trace.md)** — Execution tracer for understanding _when_ and _why_ code runs. Visualizes goroutine scheduling, garbage collection phases, network blocking, and custom span annotations. Use this when pprof (which shows _where_ CPU goes) isn't enough — you need to see the timeline of what happened. - **[Diagnostic Tools](./references/tools.md)** — Quick reference for ancillary tools: fieldalignment (struct padding waste), GODEBUG (runtime logging flags), fgprof (frame graph profiles), race detector (concurrency bugs), and others. Use this when you have a specific symptom and need a focused diagnostic — don't reach for pprof if a simpler tool already answers your question. diff --git a/skills/golang-continuous-integration/SKILL.md b/skills/golang-continuous-integration/SKILL.md index 5c6ba92..0f5128f 100644 --- a/skills/golang-continuous-integration/SKILL.md +++ b/skills/golang-continuous-integration/SKILL.md @@ -223,12 +223,12 @@ Add AI agents as PR reviewers alongside traditional static analysis. When loaded The workflow runs parallel jobs, each scoped to a set of review areas and priority level: -| Job | Areas | Priority | -| --------------- | -------------------------------------------------- | ---------------- | -| `quality` | Code style, Naming, Documentation, Design patterns | Suggestion-first | -| `correctness` | Error handling, Code safety, Concurrency | Blocking-first | -| `security` | Security, Dependencies | Blocking-first | -| `quality-depth` | Tests, Performance, Observability, Modernize | Mixed | +| Job | Areas | Priority | +| --- | --- | --- | +| `quality` | Code style, Naming, Documentation, Design patterns | Suggestion-first | +| `correctness` | Error handling, Code safety, Concurrency | Blocking-first | +| `security` | Security, Dependencies | Blocking-first | +| `quality-depth` | Tests, Performance, Observability, Modernize | Mixed | Depending on your project, also load: `golang-cli`, `golang-context`, `golang-data-structures`, `golang-database`, `golang-dependency-injection`, or any library-specific skill. diff --git a/skills/golang-continuous-integration/assets/copilot-review-instructions.md b/skills/golang-continuous-integration/assets/copilot-review-instructions.md index 7c231db..56b102f 100644 --- a/skills/golang-continuous-integration/assets/copilot-review-instructions.md +++ b/skills/golang-continuous-integration/assets/copilot-review-instructions.md @@ -6,8 +6,7 @@ # Go Code Review Instructions -You are a senior Go engineer reviewing a pull request. Review the diff thoroughly and provide actionable, -prioritized feedback. +You are a senior Go engineer reviewing a pull request. Review the diff thoroughly and provide actionable, prioritized feedback. Before considering your reply, build a list of relevant skills: @@ -58,6 +57,4 @@ Classify severity: Use inline comments on the specific diff line when possible. For concerns not tied to a specific line, post a PR-level summary. -Write short, concise comments. Only comment when there is a specific issue — do not praise the good stuff. -If you have nothing to say, post nothing. Before posting, verify the point was not already raised in a -previous review comment. +Write short, concise comments. Only comment when there is a specific issue — do not praise the good stuff. If you have nothing to say, post nothing. Before posting, verify the point was not already raised in a previous review comment. diff --git a/skills/golang-naming/SKILL.md b/skills/golang-naming/SKILL.md index 2761565..106c7f8 100644 --- a/skills/golang-naming/SKILL.md +++ b/skills/golang-naming/SKILL.md @@ -33,7 +33,7 @@ To ignore a rule, just add a comment to the code. | Element | Convention | Example | | --- | --- | --- | -| Package | lowercase, single word, _test suffix OK for test files | `json`, `http`, `tabwriter`, `http_test` | +| Package | lowercase, single word, \_test suffix OK for test files | `json`, `http`, `tabwriter`, `http_test` | | File | lowercase, underscores OK | `user_handler.go` | | Exported name | UpperCamelCase | `ReadAll`, `HTTPClient` | | Unexported | lowerCamelCase | `parseToken`, `userCount` | diff --git a/skills/golang-uber-dig/references/advanced.md b/skills/golang-uber-dig/references/advanced.md index 1d91e46..ac40058 100644 --- a/skills/golang-uber-dig/references/advanced.md +++ b/skills/golang-uber-dig/references/advanced.md @@ -51,7 +51,7 @@ type Params struct { ## Error Handling -dig wraps the constructor error with the dependency path so you can see *which* graph edge failed: +dig wraps the constructor error with the dependency path so you can see _which_ graph edge failed: ```go if err := c.Invoke(run); err != nil { @@ -82,38 +82,38 @@ _ = dig.Visualize(c, f) ### Container -| Function/Method | Purpose | -| -------------------------------- | -------------------------------------------------------- | -| `dig.New(opts...)` | Create a root container | -| `c.Provide(ctor, opts...)` | Register a constructor | -| `c.Invoke(fn, opts...)` | Run a function with injected dependencies | -| `c.Decorate(fn, opts...)` | Modify a previously-provided value within a scope | -| `c.Scope(name, opts...)` | Create a child scope (private providers by default) | -| `c.String()` | Human-readable text summary of providers (not DOT; use `dig.Visualize` for DOT) | +| Function/Method | Purpose | +| --- | --- | +| `dig.New(opts...)` | Create a root container | +| `c.Provide(ctor, opts...)` | Register a constructor | +| `c.Invoke(fn, opts...)` | Run a function with injected dependencies | +| `c.Decorate(fn, opts...)` | Modify a previously-provided value within a scope | +| `c.Scope(name, opts...)` | Create a child scope (private providers by default) | +| `c.String()` | Human-readable text summary of providers (not DOT; use `dig.Visualize` for DOT) | ### Provide options -| Option | Purpose | -| --------------------------------- | -------------------------------------------------------- | -| `dig.Name("...")` | Disambiguate same-typed providers | -| `dig.Group("...")` | Add the result to a value group | -| `dig.As(new(I))` | Provide the concrete value as one or more interfaces | -| `dig.Export(true)` | Make a scope-level provider visible from the root | -| `dig.FillProvideInfo(&info)` | Capture metadata for tooling | +| Option | Purpose | +| --- | --- | +| `dig.Name("...")` | Disambiguate same-typed providers | +| `dig.Group("...")` | Add the result to a value group | +| `dig.As(new(I))` | Provide the concrete value as one or more interfaces | +| `dig.Export(true)` | Make a scope-level provider visible from the root | +| `dig.FillProvideInfo(&info)` | Capture metadata for tooling | ### Container options -| Option | Purpose | -| ----------------------------------- | -------------------------------------------------------- | -| `dig.DeferAcyclicVerification()` | Defer cycle check to first `Invoke` | -| `dig.RecoverFromPanics()` | Convert constructor panics into `dig.PanicError` | -| `dig.DryRun(true)` | Validate without invoking constructors | +| Option | Purpose | +| --- | --- | +| `dig.DeferAcyclicVerification()` | Defer cycle check to first `Invoke` | +| `dig.RecoverFromPanics()` | Convert constructor panics into `dig.PanicError` | +| `dig.DryRun(true)` | Validate without invoking constructors | ### Errors -| Helper | Purpose | -| ----------------------------------- | -------------------------------------------------------- | -| `dig.RootCause(err)` | Unwrap to the user-returned error | -| `dig.IsCycleDetected(err)` | True if the graph has a cycle | -| `errors.As(err, &dig.PanicError{})` | Detect a recovered panic | -| `dig.Visualize(c, w, opts...)` | Write the graph in DOT format | +| Helper | Purpose | +| ----------------------------------- | --------------------------------- | +| `dig.RootCause(err)` | Unwrap to the user-returned error | +| `dig.IsCycleDetected(err)` | True if the graph has a cycle | +| `errors.As(err, &dig.PanicError{})` | Detect a recovered panic | +| `dig.Visualize(c, w, opts...)` | Write the graph in DOT format | diff --git a/skills/golang-uber-dig/references/recipes.md b/skills/golang-uber-dig/references/recipes.md index c985da8..81c7b30 100644 --- a/skills/golang-uber-dig/references/recipes.md +++ b/skills/golang-uber-dig/references/recipes.md @@ -246,7 +246,7 @@ func TestWiringIsValid(t *testing.T) { } ``` -This catches "no provider for *X" failures at build time instead of in production. +This catches "no provider for \*X" failures at build time instead of in production. ## Visualizing a failed graph diff --git a/skills/golang-uber-fx/references/advanced.md b/skills/golang-uber-fx/references/advanced.md index 4ca81e2..94717c5 100644 --- a/skills/golang-uber-fx/references/advanced.md +++ b/skills/golang-uber-fx/references/advanced.md @@ -4,11 +4,11 @@ Detail topics referenced from `SKILL.md`. Each section is self-contained. ## fx.Supply, fx.Replace, fx.Decorate -| Option | Purpose | -| ----------------------- | ----------------------------------------------------------------------------- | -| `fx.Supply(values...)` | Provide pre-built values directly. Use for config, secrets, parsed flags. | -| `fx.Replace(values...)` | Replace an already-provided type. Most useful in tests: swap real for fake. | -| `fx.Decorate(fn)` | Wrap or modify an existing value. Scoped to the surrounding module. | +| Option | Purpose | +| --- | --- | +| `fx.Supply(values...)` | Provide pre-built values directly. Use for config, secrets, parsed flags. | +| `fx.Replace(values...)` | Replace an already-provided type. Most useful in tests: swap real for fake. | +| `fx.Decorate(fn)` | Wrap or modify an existing value. Scoped to the surrounding module. | ```go fx.Supply(cfg, secret) @@ -79,57 +79,57 @@ if err := app.Stop(stopCtx); err != nil { ### Application -| Function | Purpose | -| ---------------------------- | -------------------------------------------------------- | -| `fx.New(opts...)` | Build the application graph | -| `app.Run()` | Start, wait for signal, Stop — single call | -| `app.Start(ctx)` | Run OnStart hooks in dependency order | -| `app.Stop(ctx)` | Run OnStop hooks in reverse order | -| `app.Done()` | Channel that closes on SIGINT/SIGTERM | -| `app.Err()` | Wiring error from `fx.New` (validate without starting) | +| Function | Purpose | +| ----------------- | ------------------------------------------------------ | +| `fx.New(opts...)` | Build the application graph | +| `app.Run()` | Start, wait for signal, Stop — single call | +| `app.Start(ctx)` | Run OnStart hooks in dependency order | +| `app.Stop(ctx)` | Run OnStop hooks in reverse order | +| `app.Done()` | Channel that closes on SIGINT/SIGTERM | +| `app.Err()` | Wiring error from `fx.New` (validate without starting) | ### Wiring -| Option | Purpose | -| ---------------------------- | -------------------------------------------------------- | -| `fx.Provide(ctors...)` | Register constructors | -| `fx.Invoke(fns...)` | Run functions during Start | -| `fx.Supply(values...)` | Provide pre-built values | -| `fx.Replace(values...)` | Replace previously-provided values (tests) | -| `fx.Decorate(fn)` | Wrap an existing value (module-scoped) | -| `fx.Module(name, opts...)` | Group providers/invokes/decorators | -| `fx.Options(opts...)` | Bundle options into a single value | -| `fx.Populate(targets...)` | Extract typed values from the graph (tests) | +| Option | Purpose | +| -------------------------- | ------------------------------------------- | +| `fx.Provide(ctors...)` | Register constructors | +| `fx.Invoke(fns...)` | Run functions during Start | +| `fx.Supply(values...)` | Provide pre-built values | +| `fx.Replace(values...)` | Replace previously-provided values (tests) | +| `fx.Decorate(fn)` | Wrap an existing value (module-scoped) | +| `fx.Module(name, opts...)` | Group providers/invokes/decorators | +| `fx.Options(opts...)` | Bundle options into a single value | +| `fx.Populate(targets...)` | Extract typed values from the graph (tests) | ### Annotations -| Function | Purpose | -| ------------------------------------- | ------------------------------------------------ | -| `fx.Annotate(fn, opts...)` | Tag/interface-wrap a constructor | -| `fx.ParamTags("...")` | Tag parameters of an annotated constructor | -| `fx.ResultTags("...")` | Tag results of an annotated constructor | -| `fx.As(new(I))` | Provide as one or more interfaces | -| `fx.From(types...)` | Bind annotated parameters to specific provided types | +| Function | Purpose | +| --- | --- | +| `fx.Annotate(fn, opts...)` | Tag/interface-wrap a constructor | +| `fx.ParamTags("...")` | Tag parameters of an annotated constructor | +| `fx.ResultTags("...")` | Tag results of an annotated constructor | +| `fx.As(new(I))` | Provide as one or more interfaces | +| `fx.From(types...)` | Bind annotated parameters to specific provided types | ### Lifecycle -| Helper | Purpose | -| -------------------------------------------- | --------------------------------------------- | -| `fx.Hook{OnStart, OnStop}` | Full hook with context-aware callbacks | -| `fx.StartHook(fn)` | Adapt a simple Start function | -| `fx.StopHook(fn)` | Adapt a simple Stop function | -| `fx.StartStopHook(start, stop)` | Pair of simple Start/Stop functions | -| `fx.StartTimeout(d)`, `fx.StopTimeout(d)` | Override default 15s lifecycle timeouts | -| `fx.ErrorHook(h)` | Intercept lifecycle errors (e.g. failed OnStart) for alerting or cleanup | +| Helper | Purpose | +| --- | --- | +| `fx.Hook{OnStart, OnStop}` | Full hook with context-aware callbacks | +| `fx.StartHook(fn)` | Adapt a simple Start function | +| `fx.StopHook(fn)` | Adapt a simple Stop function | +| `fx.StartStopHook(start, stop)` | Pair of simple Start/Stop functions | +| `fx.StartTimeout(d)`, `fx.StopTimeout(d)` | Override default 15s lifecycle timeouts | +| `fx.ErrorHook(h)` | Intercept lifecycle errors (e.g. failed OnStart) for alerting or cleanup | ### Logging & Testing -| Helper | Purpose | -| -------------------------------------------- | --------------------------------------------- | -| `fx.WithLogger(fn)` | Plug in a custom `fxevent.Logger` | -| `fx.NopLogger` | Silence fx event logging | -| `fxevent.ZapLogger{Logger: log}` | Bridge fx events into zap | -| `fxevent.SlogLogger{Logger: log}` | Bridge fx events into log/slog | -| `fxtest.New(t, opts...)` | App that fails the test on errors | -| `app.RequireStart()`, `app.RequireStop()` | Start/Stop with `t.Fatal` on failure | -| `fxtest.NewLifecycle(t)` | Standalone lifecycle for unit tests | +| Helper | Purpose | +| --- | --- | +| `fx.WithLogger(fn)` | Plug in a custom `fxevent.Logger` | +| `fx.NopLogger` | Silence fx event logging | +| `fxevent.ZapLogger{Logger: log}` | Bridge fx events into zap | +| `fxevent.SlogLogger{Logger: log}` | Bridge fx events into log/slog | +| `fxtest.New(t, opts...)` | App that fails the test on errors | +| `app.RequireStart()`, `app.RequireStop()` | Start/Stop with `t.Fatal` on failure | +| `fxtest.NewLifecycle(t)` | Standalone lifecycle for unit tests | diff --git a/skills/golang-uber-fx/references/testing.md b/skills/golang-uber-fx/references/testing.md index 6488e6f..af86f12 100644 --- a/skills/golang-uber-fx/references/testing.md +++ b/skills/golang-uber-fx/references/testing.md @@ -83,7 +83,7 @@ func TestWiring_MissingDependency(t *testing.T) { } ``` -Use `fx.New` (not `fxtest.New`) when you *expect* the wiring to fail — `fxtest.New` would call `t.Fatal`. +Use `fx.New` (not `fxtest.New`) when you _expect_ the wiring to fail — `fxtest.New` would call `t.Fatal`. ## Validating the production graph in CI @@ -123,7 +123,7 @@ require.NotEmpty(t, recorded.FilterMessage("OnStart hook executed").All()) ## Testing a lifecycle hook in isolation -If a constructor returns a value *and* registers a hook, you often want to test both halves: +If a constructor returns a value _and_ registers a hook, you often want to test both halves: ```go func TestNewServer_OnStartFailsBindError(t *testing.T) {