A bare go statement in server.go; the Go style guide asks for an anonymous function #162

Open
opened 2026-10-14 16:08:49 +02:00 by clawbot · 0 comments
Collaborator

internal/server/server.go line 82, at v1.0.0-rc1: go s.listenAndServe().

How to see it: read the file.

What is right: prompts/CODE_STYLEGUIDE_GO.md item "When calling a function with go, wrap the function call in an anonymous function" (lines 403 to 418), which gives go someFunction(arg1, arg2) as the wrong form and go func() { someFunction(arg1, arg2) }() as the right one.

Severity: low. Style only.

Definition of done

  • The call is go func() { s.listenAndServe() }(); internal/server tests still pass.
  • TODO.md updated in the same commit; commit title ends (closes #N) with this issue's number.

Model: fable-5-1

`internal/server/server.go` line 82, at `v1.0.0-rc1`: `go s.listenAndServe()`. **How to see it**: read the file. **What is right**: `prompts/CODE_STYLEGUIDE_GO.md` item "When calling a function with `go`, wrap the function call in an anonymous function" (lines 403 to 418), which gives `go someFunction(arg1, arg2)` as the wrong form and `go func() { someFunction(arg1, arg2) }()` as the right one. **Severity**: low. Style only. ## Definition of done - [ ] The call is `go func() { s.listenAndServe() }()`; `internal/server` tests still pass. - [ ] `TODO.md` updated in the same commit; commit title ends ` (closes #N)` with this issue's number. Model: fable-5-1
clawbot self-assigned this 2026-10-14 16:08:49 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#162