Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
.agents/skills/golang/SKILL.md
Outdated
| - Store dependencies on service structs via constructor-based dependency injection. Do NOT hide dependencies in session manager state. | ||
| - Avoid shallow helpers that are just a one-line wrapper around another method, especially when they are only used once. | ||
| - When using a slog logger, always use the context-aware methods: `DebugContext`, `InfoContext`, `WarnContext`, `ErrorContext`. | ||
| - When logging errors make sure to always include them in the log payload using `slog.String("error", err)`. Example: `logger.ErrorContext(ctx, "failed to write to database", slog.String("error", err))`. |
There was a problem hiding this comment.
🚩 Pre-existing incorrect attr.SlogError call signature in logging examples
Line 25 was correctly updated to attr.SlogError(err) (one argument), matching the actual function signature func SlogError(v error) slog.Attr at server/internal/attr/conventions.go:266. However, the pre-existing logging examples at .agents/skills/golang/SKILL.md:348 and .agents/skills/golang/SKILL.md:362 still show attr.SlogError("error", err) — passing two arguments to a one-argument function. This would be a compile error if an agent followed these examples. Since this PR specifically updated the instruction text on line 25 to the correct form, it would be a good opportunity to also fix the examples below to match.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
|
||
| </bad-example> | ||
|
|
||
| <good-example> |
There was a problem hiding this comment.
I'm not sure this is a good example that contrasts with the bad example. The bad example above is setting up a service. This example is setting up a dependency of sorts.
Summary
repo.Querieson new services and keeping dependencies out of session manager statet.Context()andtestify/mockfor third-party integrations